MCPcopy Create free account
hub / github.com/clientdb/clientdb / findInSource

Function findInSource

core/find.ts:110–121  ·  view source on GitHub ↗
(
  source: MaybeObservableArray<Entity<Data, View>>,
  store: EntityStore<Data, View>,
  input: FindInput<Data, View>
)

Source from the content-addressed store, hash-verified

108 : never;
109
110export 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}

Callers 1

createEntityQueryFunction · 0.90

Calls 1

Tested by

no test coverage detected