You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
data: Array<EntityNew<Schema.Schema.AnyNoContext>>;// holds the decoded entities of this query and must be a stable reference and use the same reference for the `entities` array
6
+
listeners: Array<()=>void>;// listeners to this query
type: Schema.Schema.AnyNoContext;// TODO should be the type of the entity
13
+
entities: Map<string,EntityNew<Schema.Schema.AnyNoContext>>;// holds all entities of this type
14
+
queries: Map<
15
+
string,// instead of serializedQueryKey as string we could also have the actual params
16
+
QueryEntry
17
+
>;
18
+
isInvalidated: boolean;
19
+
};
20
+
21
+
/*
22
+
/*
23
+
* Note: Currently we only use one global cache for all entities.
24
+
* In the future we probably want a build function that creates a cache and returns the
25
+
* functions (create, update, findMany, …) that use this specific cache.
26
+
*
27
+
* How does it work?
28
+
*
29
+
* We store all decoded entities in a cache and for each query we reference the entities relevant to this query.
30
+
* Whenever a query is registered we add it to the cache and add a listener to the query. Whenever a query is unregistered we remove the listener from the query.
0 commit comments