( source: MaybeObservableArray<Entity<Data, View>>, store: EntityStore<Data, View>, input: FindInput<Data, View> )
| 108 | : never; |
| 109 | |
| 110 | export function findInSource<Data, View>( |
| 111 | source: MaybeObservableArray<Entity<Data, View>>, |
| 112 | store: EntityStore<Data, View>, |
| 113 | input: FindInput<Data, View> |
| 114 | ) { |
| 115 | if (typeof input === "function") { |
| 116 | // ! Do not pass filter directly as it will break cache (filter pass 3 arguments) |
| 117 | return source.filter((item) => input(item)); |
| 118 | } |
| 119 | |
| 120 | return findInSourceByObjectInput(source, store, input); |
| 121 | } |
no test coverage detected