@oimdb/react 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +41 -52
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +42 -53
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -36,95 +36,84 @@ module.exports = __toCommonJS(index_exports);
|
|
|
36
36
|
// src/hooks/index.ts
|
|
37
37
|
var import_react = require("react");
|
|
38
38
|
var import_react2 = require("react");
|
|
39
|
+
var EMPTY_ARRAY = [];
|
|
39
40
|
var useSelectPksByIndexKeys = (reactiveIndex, keys) => {
|
|
41
|
+
const snapshotValueRef = (0, import_react.useRef)(null);
|
|
40
42
|
const subscribe = (0, import_react.useMemo)(() => {
|
|
41
|
-
return (onStoreChange) => reactiveIndex.updateEventEmitter.subscribeOnKeys(
|
|
42
|
-
keys
|
|
43
|
-
onStoreChange
|
|
44
|
-
);
|
|
43
|
+
return (onStoreChange) => reactiveIndex.updateEventEmitter.subscribeOnKeys(keys, () => {
|
|
44
|
+
snapshotValueRef.current = keys.map((key) => Array.from(reactiveIndex.getPksByKey(key))).flat();
|
|
45
|
+
onStoreChange();
|
|
46
|
+
});
|
|
45
47
|
}, [keys, reactiveIndex.updateEventEmitter]);
|
|
46
48
|
const getSnapshot = (0, import_react.useMemo)(() => {
|
|
47
|
-
let cachedResult = null;
|
|
48
|
-
let cachedKeys = null;
|
|
49
49
|
return () => {
|
|
50
|
-
|
|
51
|
-
cachedResult = keys.map((key) => reactiveIndex.getPksByKey(key));
|
|
52
|
-
cachedKeys = keys;
|
|
53
|
-
}
|
|
54
|
-
return cachedResult;
|
|
50
|
+
return snapshotValueRef.current;
|
|
55
51
|
};
|
|
56
|
-
}, [
|
|
52
|
+
}, []);
|
|
57
53
|
const snapshot = (0, import_react2.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
58
54
|
return snapshot;
|
|
59
55
|
};
|
|
60
56
|
var useSelectPksByIndexKey = (reactiveIndex, key) => {
|
|
57
|
+
const snapshotValueRef = (0, import_react.useRef)(null);
|
|
61
58
|
const subscribe = (0, import_react.useMemo)(() => {
|
|
62
|
-
return (onStoreChange) => reactiveIndex.updateEventEmitter.subscribeOnKey(key,
|
|
59
|
+
return (onStoreChange) => reactiveIndex.updateEventEmitter.subscribeOnKey(key, () => {
|
|
60
|
+
snapshotValueRef.current = Array.from(
|
|
61
|
+
reactiveIndex.getPksByKey(key)
|
|
62
|
+
);
|
|
63
|
+
onStoreChange();
|
|
64
|
+
});
|
|
63
65
|
}, [key, reactiveIndex.updateEventEmitter]);
|
|
64
|
-
const getSnapshot = (0, import_react.useMemo)(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const getSnapshot = (0, import_react.useMemo)(() => {
|
|
67
|
+
return () => {
|
|
68
|
+
return snapshotValueRef.current;
|
|
69
|
+
};
|
|
70
|
+
}, []);
|
|
68
71
|
const snapshot = (0, import_react2.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
69
72
|
return snapshot;
|
|
70
73
|
};
|
|
71
74
|
var selectEntityByPk = (reactiveCollection, pk) => {
|
|
75
|
+
const snapshotValueRef = (0, import_react.useRef)(void 0);
|
|
72
76
|
const subscribe = (0, import_react.useMemo)(() => {
|
|
73
|
-
return (onStoreChange) => reactiveCollection.updateEventEmitter.subscribeOnKey(
|
|
74
|
-
pk
|
|
75
|
-
onStoreChange
|
|
76
|
-
);
|
|
77
|
+
return (onStoreChange) => reactiveCollection.updateEventEmitter.subscribeOnKey(pk, () => {
|
|
78
|
+
snapshotValueRef.current = reactiveCollection.getOneByPk(pk);
|
|
79
|
+
onStoreChange();
|
|
80
|
+
});
|
|
77
81
|
}, [pk, reactiveCollection.updateEventEmitter]);
|
|
78
|
-
const getSnapshot = (0, import_react.useMemo)(
|
|
79
|
-
() => () => reactiveCollection.getOneByPk(pk),
|
|
80
|
-
[pk, reactiveCollection]
|
|
81
|
-
);
|
|
82
|
+
const getSnapshot = (0, import_react.useMemo)(() => () => snapshotValueRef.current, []);
|
|
82
83
|
const snapshot = (0, import_react2.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
83
84
|
return snapshot;
|
|
84
85
|
};
|
|
85
86
|
var useSelectEntitiesByPks = (reactiveCollection, pks) => {
|
|
87
|
+
const snapshotValueRef = (0, import_react.useRef)(null);
|
|
86
88
|
const subscribe = (0, import_react.useMemo)(() => {
|
|
87
|
-
return (onStoreChange) => reactiveCollection.updateEventEmitter.subscribeOnKeys(
|
|
88
|
-
pks
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
return (onStoreChange) => reactiveCollection.updateEventEmitter.subscribeOnKeys(pks, () => {
|
|
90
|
+
snapshotValueRef.current = pks.map(
|
|
91
|
+
(pk) => reactiveCollection.getOneByPk(pk)
|
|
92
|
+
);
|
|
93
|
+
onStoreChange();
|
|
94
|
+
});
|
|
91
95
|
}, [pks, reactiveCollection.updateEventEmitter]);
|
|
92
96
|
const getSnapshot = (0, import_react.useMemo)(() => {
|
|
93
|
-
let cachedResult = null;
|
|
94
|
-
let cachedPks = null;
|
|
95
97
|
return () => {
|
|
96
|
-
|
|
97
|
-
cachedResult = pks.map((pk) => reactiveCollection.getOneByPk(pk));
|
|
98
|
-
cachedPks = pks;
|
|
99
|
-
}
|
|
100
|
-
return cachedResult;
|
|
98
|
+
return snapshotValueRef.current;
|
|
101
99
|
};
|
|
102
|
-
}, [
|
|
100
|
+
}, []);
|
|
103
101
|
const snapshot = (0, import_react2.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
104
102
|
return snapshot;
|
|
105
103
|
};
|
|
106
104
|
var selectEntitiesByIndexKey = (reactiveCollection, reactiveIndex, key) => {
|
|
107
105
|
const pks = useSelectPksByIndexKey(reactiveIndex, key);
|
|
108
|
-
return useSelectEntitiesByPks(
|
|
106
|
+
return useSelectEntitiesByPks(
|
|
107
|
+
reactiveCollection,
|
|
108
|
+
pks || EMPTY_ARRAY
|
|
109
|
+
);
|
|
109
110
|
};
|
|
110
111
|
var unique = (array) => {
|
|
111
112
|
return Array.from(new Set(array));
|
|
112
113
|
};
|
|
113
114
|
var selectEntitiesByIndexKeys = (reactiveCollection, reactiveIndex, keys) => {
|
|
114
|
-
const pks = useSelectPksByIndexKeys(reactiveIndex, keys);
|
|
115
|
-
|
|
116
|
-
let cachedResult = null;
|
|
117
|
-
let cachedPks = null;
|
|
118
|
-
const getCurrentPksArray = () => {
|
|
119
|
-
if (cachedPks !== pks || !cachedResult) {
|
|
120
|
-
cachedResult = unique(Array.from(pks.values()).flat());
|
|
121
|
-
cachedPks = pks;
|
|
122
|
-
}
|
|
123
|
-
return cachedResult;
|
|
124
|
-
};
|
|
125
|
-
return getCurrentPksArray();
|
|
126
|
-
}, [pks]);
|
|
127
|
-
return useSelectEntitiesByPks(reactiveCollection, pksArray);
|
|
115
|
+
const pks = useSelectPksByIndexKeys(reactiveIndex, keys) || EMPTY_ARRAY;
|
|
116
|
+
return useSelectEntitiesByPks(reactiveCollection, unique(Array.from(pks)));
|
|
128
117
|
};
|
|
129
118
|
|
|
130
119
|
// src/context/index.tsx
|
package/dist/index.d.cts
CHANGED
|
@@ -3,12 +3,12 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
|
|
6
|
-
declare const useSelectPksByIndexKeys: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, keys: readonly TKey[]) => readonly
|
|
7
|
-
declare const useSelectPksByIndexKey: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, key: TKey) => readonly TPk[];
|
|
6
|
+
declare const useSelectPksByIndexKeys: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, keys: readonly TKey[]) => readonly TPk[] | null;
|
|
7
|
+
declare const useSelectPksByIndexKey: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, key: TKey) => readonly TPk[] | null;
|
|
8
8
|
declare const selectEntityByPk: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pk: TPk) => TEntity | undefined;
|
|
9
|
-
declare const useSelectEntitiesByPks: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pks: readonly TPk[]) =>
|
|
10
|
-
declare const selectEntitiesByIndexKey: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, key: TKey) =>
|
|
11
|
-
declare const selectEntitiesByIndexKeys: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, keys: readonly TKey[]) =>
|
|
9
|
+
declare const useSelectEntitiesByPks: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pks: readonly TPk[]) => readonly TEntity[] | null;
|
|
10
|
+
declare const selectEntitiesByIndexKey: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, key: TKey) => readonly TEntity[] | null;
|
|
11
|
+
declare const selectEntitiesByIndexKeys: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, keys: readonly TKey[]) => readonly TEntity[] | null;
|
|
12
12
|
|
|
13
13
|
type AnyOIMRICollection = OIMRICollection<object, TOIMPk, string, TOIMPk, any, any>;
|
|
14
14
|
type CollectionsDictionary = Record<string, AnyOIMRICollection>;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
|
|
6
|
-
declare const useSelectPksByIndexKeys: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, keys: readonly TKey[]) => readonly
|
|
7
|
-
declare const useSelectPksByIndexKey: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, key: TKey) => readonly TPk[];
|
|
6
|
+
declare const useSelectPksByIndexKeys: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, keys: readonly TKey[]) => readonly TPk[] | null;
|
|
7
|
+
declare const useSelectPksByIndexKey: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, key: TKey) => readonly TPk[] | null;
|
|
8
8
|
declare const selectEntityByPk: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pk: TPk) => TEntity | undefined;
|
|
9
|
-
declare const useSelectEntitiesByPks: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pks: readonly TPk[]) =>
|
|
10
|
-
declare const selectEntitiesByIndexKey: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, key: TKey) =>
|
|
11
|
-
declare const selectEntitiesByIndexKeys: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, keys: readonly TKey[]) =>
|
|
9
|
+
declare const useSelectEntitiesByPks: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pks: readonly TPk[]) => readonly TEntity[] | null;
|
|
10
|
+
declare const selectEntitiesByIndexKey: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, key: TKey) => readonly TEntity[] | null;
|
|
11
|
+
declare const selectEntitiesByIndexKeys: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndex<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndex<TKey, TPk, TIndex>, keys: readonly TKey[]) => readonly TEntity[] | null;
|
|
12
12
|
|
|
13
13
|
type AnyOIMRICollection = OIMRICollection<object, TOIMPk, string, TOIMPk, any, any>;
|
|
14
14
|
type CollectionsDictionary = Record<string, AnyOIMRICollection>;
|
package/dist/index.js
CHANGED
|
@@ -1,95 +1,84 @@
|
|
|
1
1
|
// src/hooks/index.ts
|
|
2
|
-
import { useMemo } from "react";
|
|
2
|
+
import { useMemo, useRef } from "react";
|
|
3
3
|
import { useSyncExternalStore } from "react";
|
|
4
|
+
var EMPTY_ARRAY = [];
|
|
4
5
|
var useSelectPksByIndexKeys = (reactiveIndex, keys) => {
|
|
6
|
+
const snapshotValueRef = useRef(null);
|
|
5
7
|
const subscribe = useMemo(() => {
|
|
6
|
-
return (onStoreChange) => reactiveIndex.updateEventEmitter.subscribeOnKeys(
|
|
7
|
-
keys
|
|
8
|
-
onStoreChange
|
|
9
|
-
);
|
|
8
|
+
return (onStoreChange) => reactiveIndex.updateEventEmitter.subscribeOnKeys(keys, () => {
|
|
9
|
+
snapshotValueRef.current = keys.map((key) => Array.from(reactiveIndex.getPksByKey(key))).flat();
|
|
10
|
+
onStoreChange();
|
|
11
|
+
});
|
|
10
12
|
}, [keys, reactiveIndex.updateEventEmitter]);
|
|
11
13
|
const getSnapshot = useMemo(() => {
|
|
12
|
-
let cachedResult = null;
|
|
13
|
-
let cachedKeys = null;
|
|
14
14
|
return () => {
|
|
15
|
-
|
|
16
|
-
cachedResult = keys.map((key) => reactiveIndex.getPksByKey(key));
|
|
17
|
-
cachedKeys = keys;
|
|
18
|
-
}
|
|
19
|
-
return cachedResult;
|
|
15
|
+
return snapshotValueRef.current;
|
|
20
16
|
};
|
|
21
|
-
}, [
|
|
17
|
+
}, []);
|
|
22
18
|
const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
23
19
|
return snapshot;
|
|
24
20
|
};
|
|
25
21
|
var useSelectPksByIndexKey = (reactiveIndex, key) => {
|
|
22
|
+
const snapshotValueRef = useRef(null);
|
|
26
23
|
const subscribe = useMemo(() => {
|
|
27
|
-
return (onStoreChange) => reactiveIndex.updateEventEmitter.subscribeOnKey(key,
|
|
24
|
+
return (onStoreChange) => reactiveIndex.updateEventEmitter.subscribeOnKey(key, () => {
|
|
25
|
+
snapshotValueRef.current = Array.from(
|
|
26
|
+
reactiveIndex.getPksByKey(key)
|
|
27
|
+
);
|
|
28
|
+
onStoreChange();
|
|
29
|
+
});
|
|
28
30
|
}, [key, reactiveIndex.updateEventEmitter]);
|
|
29
|
-
const getSnapshot = useMemo(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const getSnapshot = useMemo(() => {
|
|
32
|
+
return () => {
|
|
33
|
+
return snapshotValueRef.current;
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
33
36
|
const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
34
37
|
return snapshot;
|
|
35
38
|
};
|
|
36
39
|
var selectEntityByPk = (reactiveCollection, pk) => {
|
|
40
|
+
const snapshotValueRef = useRef(void 0);
|
|
37
41
|
const subscribe = useMemo(() => {
|
|
38
|
-
return (onStoreChange) => reactiveCollection.updateEventEmitter.subscribeOnKey(
|
|
39
|
-
pk
|
|
40
|
-
onStoreChange
|
|
41
|
-
);
|
|
42
|
+
return (onStoreChange) => reactiveCollection.updateEventEmitter.subscribeOnKey(pk, () => {
|
|
43
|
+
snapshotValueRef.current = reactiveCollection.getOneByPk(pk);
|
|
44
|
+
onStoreChange();
|
|
45
|
+
});
|
|
42
46
|
}, [pk, reactiveCollection.updateEventEmitter]);
|
|
43
|
-
const getSnapshot = useMemo(
|
|
44
|
-
() => () => reactiveCollection.getOneByPk(pk),
|
|
45
|
-
[pk, reactiveCollection]
|
|
46
|
-
);
|
|
47
|
+
const getSnapshot = useMemo(() => () => snapshotValueRef.current, []);
|
|
47
48
|
const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
48
49
|
return snapshot;
|
|
49
50
|
};
|
|
50
51
|
var useSelectEntitiesByPks = (reactiveCollection, pks) => {
|
|
52
|
+
const snapshotValueRef = useRef(null);
|
|
51
53
|
const subscribe = useMemo(() => {
|
|
52
|
-
return (onStoreChange) => reactiveCollection.updateEventEmitter.subscribeOnKeys(
|
|
53
|
-
pks
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
return (onStoreChange) => reactiveCollection.updateEventEmitter.subscribeOnKeys(pks, () => {
|
|
55
|
+
snapshotValueRef.current = pks.map(
|
|
56
|
+
(pk) => reactiveCollection.getOneByPk(pk)
|
|
57
|
+
);
|
|
58
|
+
onStoreChange();
|
|
59
|
+
});
|
|
56
60
|
}, [pks, reactiveCollection.updateEventEmitter]);
|
|
57
61
|
const getSnapshot = useMemo(() => {
|
|
58
|
-
let cachedResult = null;
|
|
59
|
-
let cachedPks = null;
|
|
60
62
|
return () => {
|
|
61
|
-
|
|
62
|
-
cachedResult = pks.map((pk) => reactiveCollection.getOneByPk(pk));
|
|
63
|
-
cachedPks = pks;
|
|
64
|
-
}
|
|
65
|
-
return cachedResult;
|
|
63
|
+
return snapshotValueRef.current;
|
|
66
64
|
};
|
|
67
|
-
}, [
|
|
65
|
+
}, []);
|
|
68
66
|
const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
69
67
|
return snapshot;
|
|
70
68
|
};
|
|
71
69
|
var selectEntitiesByIndexKey = (reactiveCollection, reactiveIndex, key) => {
|
|
72
70
|
const pks = useSelectPksByIndexKey(reactiveIndex, key);
|
|
73
|
-
return useSelectEntitiesByPks(
|
|
71
|
+
return useSelectEntitiesByPks(
|
|
72
|
+
reactiveCollection,
|
|
73
|
+
pks || EMPTY_ARRAY
|
|
74
|
+
);
|
|
74
75
|
};
|
|
75
76
|
var unique = (array) => {
|
|
76
77
|
return Array.from(new Set(array));
|
|
77
78
|
};
|
|
78
79
|
var selectEntitiesByIndexKeys = (reactiveCollection, reactiveIndex, keys) => {
|
|
79
|
-
const pks = useSelectPksByIndexKeys(reactiveIndex, keys);
|
|
80
|
-
|
|
81
|
-
let cachedResult = null;
|
|
82
|
-
let cachedPks = null;
|
|
83
|
-
const getCurrentPksArray = () => {
|
|
84
|
-
if (cachedPks !== pks || !cachedResult) {
|
|
85
|
-
cachedResult = unique(Array.from(pks.values()).flat());
|
|
86
|
-
cachedPks = pks;
|
|
87
|
-
}
|
|
88
|
-
return cachedResult;
|
|
89
|
-
};
|
|
90
|
-
return getCurrentPksArray();
|
|
91
|
-
}, [pks]);
|
|
92
|
-
return useSelectEntitiesByPks(reactiveCollection, pksArray);
|
|
80
|
+
const pks = useSelectPksByIndexKeys(reactiveIndex, keys) || EMPTY_ARRAY;
|
|
81
|
+
return useSelectEntitiesByPks(reactiveCollection, unique(Array.from(pks)));
|
|
93
82
|
};
|
|
94
83
|
|
|
95
84
|
// src/context/index.tsx
|