Skip to content

Commit

Permalink
Merge pull request #1603 from betocantu93/patch-3
Browse files Browse the repository at this point in the history
isSliceable is not working for ember data 3.x hasmany relationships
  • Loading branch information
mkszepp authored Nov 13, 2023
2 parents a1cd21c + b54dd1e commit 1ed10b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addon/components/power-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
// @ts-ignore
import { restartableTask, timeout } from 'ember-concurrency';
import type { Dropdown, DropdownActions } from 'ember-basic-dropdown/components/basic-dropdown';
import { isArray } from '@ember/array';

interface SelectActions extends DropdownActions {
search: (term: string) => void
Expand Down Expand Up @@ -90,7 +91,7 @@ export interface PowerSelectArgs {
}

const isSliceable = <T>(coll: any): coll is Sliceable<T> => {
return typeof coll.slice === 'function' && typeof coll.sort === 'function';
return isArray(coll);
}

const isPromiseLike = <T>(thing: any): thing is Promise<T> => {
Expand Down

0 comments on commit 1ed10b4

Please sign in to comment.