tinybase 0.9.3 → 1.0.2
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/LICENSE +1 -1
- package/lib/debug/checkpoints.d.ts +3 -0
- package/lib/debug/common.d.ts +56 -0
- package/lib/debug/indexes.d.ts +7 -58
- package/lib/debug/metrics.d.ts +6 -2
- package/lib/debug/persisters.d.ts +15 -8
- package/lib/debug/relationships.d.ts +3 -1
- package/lib/debug/store.d.ts +13 -10
- package/lib/debug/tinybase.js +16 -8
- package/lib/debug/ui-react.d.ts +29 -2
- package/lib/debug/ui-react.js +8 -2
- package/package.json +28 -12
- package/readme.md +2 -2
- package/lib/checkpoints.d.ts +0 -876
- package/lib/checkpoints.js +0 -1
- package/lib/checkpoints.js.gz +0 -0
- package/lib/common.d.ts +0 -59
- package/lib/debug/checkpoints.js +0 -326
- package/lib/debug/indexes.js +0 -390
- package/lib/debug/metrics.js +0 -391
- package/lib/debug/persisters.js +0 -191
- package/lib/debug/relationships.js +0 -418
- package/lib/debug/store.js +0 -725
- package/lib/indexes.d.ts +0 -829
- package/lib/indexes.js +0 -1
- package/lib/indexes.js.gz +0 -0
- package/lib/metrics.d.ts +0 -753
- package/lib/metrics.js +0 -1
- package/lib/metrics.js.gz +0 -0
- package/lib/persisters.d.ts +0 -704
- package/lib/persisters.js +0 -1
- package/lib/persisters.js.gz +0 -0
- package/lib/relationships.d.ts +0 -1114
- package/lib/relationships.js +0 -1
- package/lib/relationships.js.gz +0 -0
- package/lib/store.d.ts +0 -2503
- package/lib/store.js +0 -1
- package/lib/store.js.gz +0 -0
- package/lib/tinybase.d.ts +0 -13
- package/lib/tinybase.js +0 -1
- package/lib/tinybase.js.gz +0 -0
- package/lib/ui-react.d.ts +0 -7158
- package/lib/ui-react.js +0 -1
- package/lib/ui-react.js.gz +0 -0
- package/lib/umd/checkpoints.js +0 -1
- package/lib/umd/checkpoints.js.gz +0 -0
- package/lib/umd/indexes.js +0 -1
- package/lib/umd/indexes.js.gz +0 -0
- package/lib/umd/metrics.js +0 -1
- package/lib/umd/metrics.js.gz +0 -0
- package/lib/umd/persisters.js +0 -1
- package/lib/umd/persisters.js.gz +0 -0
- package/lib/umd/relationships.js +0 -1
- package/lib/umd/relationships.js.gz +0 -0
- package/lib/umd/store.js +0 -1
- package/lib/umd/store.js.gz +0 -0
- package/lib/umd/tinybase.js +0 -1
- package/lib/umd/tinybase.js.gz +0 -0
- package/lib/umd/ui-react.js +0 -1
- package/lib/umd/ui-react.js.gz +0 -0
package/lib/debug/indexes.js
DELETED
|
@@ -1,390 +0,0 @@
|
|
|
1
|
-
const getTypeOf = (thing) => typeof thing;
|
|
2
|
-
const EMPTY_STRING = '';
|
|
3
|
-
const STRING = getTypeOf(EMPTY_STRING);
|
|
4
|
-
|
|
5
|
-
const arrayIsSorted = (array, sorter) =>
|
|
6
|
-
array.every(
|
|
7
|
-
(value, index) => index == 0 || sorter(array[index - 1], value) <= 0,
|
|
8
|
-
);
|
|
9
|
-
const arraySort = (array, sorter) => array.sort(sorter);
|
|
10
|
-
const arrayForEach = (array, cb) => array.forEach(cb);
|
|
11
|
-
const arrayLength = (array) => array.length;
|
|
12
|
-
const arrayIsEmpty = (array) => arrayLength(array) == 0;
|
|
13
|
-
const arrayReduce = (array, cb, initial) => array.reduce(cb, initial);
|
|
14
|
-
const arrayFromSecond = (ids) => ids.slice(1);
|
|
15
|
-
|
|
16
|
-
const isUndefined = (thing) => thing == void 0;
|
|
17
|
-
const ifNotUndefined = (value, then, otherwise) =>
|
|
18
|
-
isUndefined(value) ? otherwise?.() : then(value);
|
|
19
|
-
const isString = (thing) => getTypeOf(thing) == STRING;
|
|
20
|
-
|
|
21
|
-
const collSizeN = (collSizer) => (coll) =>
|
|
22
|
-
arrayReduce(collValues(coll), (total, coll2) => total + collSizer(coll2), 0);
|
|
23
|
-
const collSize = (coll) => coll.size;
|
|
24
|
-
const collSize2 = collSizeN(collSize);
|
|
25
|
-
const collSize3 = collSizeN(collSize2);
|
|
26
|
-
const collHas = (coll, keyOrValue) => coll?.has(keyOrValue) ?? false;
|
|
27
|
-
const collIsEmpty = (coll) => isUndefined(coll) || collSize(coll) == 0;
|
|
28
|
-
const collValues = (coll) => [...(coll?.values() ?? [])];
|
|
29
|
-
const collClear = (coll) => coll.clear();
|
|
30
|
-
const collForEach = (coll, cb) => coll?.forEach(cb);
|
|
31
|
-
const collDel = (coll, keyOrValue) => coll?.delete(keyOrValue);
|
|
32
|
-
|
|
33
|
-
const mapNew = (entries) => new Map(entries);
|
|
34
|
-
const mapKeys = (map) => [...(map?.keys() ?? [])];
|
|
35
|
-
const mapGet = (map, key) => map?.get(key);
|
|
36
|
-
const mapForEach = (map, cb) =>
|
|
37
|
-
collForEach(map, (value, key) => cb(key, value));
|
|
38
|
-
const mapSet = (map, key, value) =>
|
|
39
|
-
isUndefined(value) ? (collDel(map, key), map) : map?.set(key, value);
|
|
40
|
-
const mapEnsure = (map, key, defaultValue, onWillAdd) => {
|
|
41
|
-
if (!collHas(map, key)) {
|
|
42
|
-
onWillAdd?.(defaultValue);
|
|
43
|
-
map.set(key, defaultValue);
|
|
44
|
-
}
|
|
45
|
-
return mapGet(map, key);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const setNew = (entries) => new Set(entries);
|
|
49
|
-
const setAdd = (set, value) => set?.add(value);
|
|
50
|
-
|
|
51
|
-
const getDefinableFunctions = (store, getDefaultThing, validateRowValue) => {
|
|
52
|
-
const hasRow = store.hasRow;
|
|
53
|
-
const tableIds = mapNew();
|
|
54
|
-
const things = mapNew();
|
|
55
|
-
const allRowValues = mapNew();
|
|
56
|
-
const allSortKeys = mapNew();
|
|
57
|
-
const storeListenerIds = mapNew();
|
|
58
|
-
const getStore = () => store;
|
|
59
|
-
const getThingIds = () => mapKeys(tableIds);
|
|
60
|
-
const getTableId = (id) => mapGet(tableIds, id);
|
|
61
|
-
const getThing = (id) => mapGet(things, id);
|
|
62
|
-
const setThing = (id, thing) => mapSet(things, id, thing);
|
|
63
|
-
const removeStoreListeners = (id) =>
|
|
64
|
-
ifNotUndefined(mapGet(storeListenerIds, id), (listenerIds) => {
|
|
65
|
-
collForEach(listenerIds, store.delListener);
|
|
66
|
-
mapSet(storeListenerIds, id);
|
|
67
|
-
});
|
|
68
|
-
const setDefinition = (id, tableId, onChanged, getRowValue, getSortKey) => {
|
|
69
|
-
const changedRowValues = mapNew();
|
|
70
|
-
const changedSortKeys = mapNew();
|
|
71
|
-
mapSet(tableIds, id, tableId);
|
|
72
|
-
if (!collHas(things, id)) {
|
|
73
|
-
mapSet(things, id, getDefaultThing());
|
|
74
|
-
mapSet(allRowValues, id, mapNew());
|
|
75
|
-
mapSet(allSortKeys, id, mapNew());
|
|
76
|
-
}
|
|
77
|
-
const rowValues = mapGet(allRowValues, id);
|
|
78
|
-
const sortKeys = mapGet(allSortKeys, id);
|
|
79
|
-
const processRow = (rowId) => {
|
|
80
|
-
const getCell = (cellId) => store.getCell(tableId, rowId, cellId);
|
|
81
|
-
const oldRowValue = mapGet(rowValues, rowId);
|
|
82
|
-
const newRowValue = hasRow(tableId, rowId)
|
|
83
|
-
? validateRowValue(getRowValue(getCell, rowId))
|
|
84
|
-
: void 0;
|
|
85
|
-
if (oldRowValue != newRowValue) {
|
|
86
|
-
mapSet(changedRowValues, rowId, [oldRowValue, newRowValue]);
|
|
87
|
-
}
|
|
88
|
-
if (!isUndefined(getSortKey)) {
|
|
89
|
-
const oldSortKey = mapGet(sortKeys, rowId);
|
|
90
|
-
const newSortKey = hasRow(tableId, rowId)
|
|
91
|
-
? getSortKey(getCell, rowId)
|
|
92
|
-
: void 0;
|
|
93
|
-
if (oldSortKey != newSortKey) {
|
|
94
|
-
mapSet(changedSortKeys, rowId, newSortKey);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const processTable = (force) => {
|
|
99
|
-
onChanged(
|
|
100
|
-
() => {
|
|
101
|
-
collForEach(changedRowValues, ([, newRowValue], rowId) =>
|
|
102
|
-
mapSet(rowValues, rowId, newRowValue),
|
|
103
|
-
);
|
|
104
|
-
collForEach(changedSortKeys, (newSortKey, rowId) =>
|
|
105
|
-
mapSet(sortKeys, rowId, newSortKey),
|
|
106
|
-
);
|
|
107
|
-
},
|
|
108
|
-
changedRowValues,
|
|
109
|
-
changedSortKeys,
|
|
110
|
-
rowValues,
|
|
111
|
-
sortKeys,
|
|
112
|
-
force,
|
|
113
|
-
);
|
|
114
|
-
collClear(changedRowValues);
|
|
115
|
-
collClear(changedSortKeys);
|
|
116
|
-
};
|
|
117
|
-
mapForEach(rowValues, processRow);
|
|
118
|
-
if (store.hasTable(tableId)) {
|
|
119
|
-
arrayForEach(store.getRowIds(tableId), (rowId) => {
|
|
120
|
-
if (!collHas(rowValues, rowId)) {
|
|
121
|
-
processRow(rowId);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
processTable(true);
|
|
126
|
-
removeStoreListeners(id);
|
|
127
|
-
mapSet(
|
|
128
|
-
storeListenerIds,
|
|
129
|
-
id,
|
|
130
|
-
setNew([
|
|
131
|
-
store.addRowListener(tableId, null, (_store, _tableId, rowId) =>
|
|
132
|
-
processRow(rowId),
|
|
133
|
-
),
|
|
134
|
-
store.addTableListener(tableId, () => processTable()),
|
|
135
|
-
]),
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
const delDefinition = (id) => {
|
|
139
|
-
mapSet(tableIds, id);
|
|
140
|
-
mapSet(things, id);
|
|
141
|
-
mapSet(allRowValues, id);
|
|
142
|
-
mapSet(allSortKeys, id);
|
|
143
|
-
removeStoreListeners(id);
|
|
144
|
-
};
|
|
145
|
-
const destroy = () => mapForEach(storeListenerIds, delDefinition);
|
|
146
|
-
return [
|
|
147
|
-
getStore,
|
|
148
|
-
getThingIds,
|
|
149
|
-
getTableId,
|
|
150
|
-
getThing,
|
|
151
|
-
setThing,
|
|
152
|
-
setDefinition,
|
|
153
|
-
delDefinition,
|
|
154
|
-
destroy,
|
|
155
|
-
];
|
|
156
|
-
};
|
|
157
|
-
const getRowCellFunction = (getRowCell, defaultCellValue) =>
|
|
158
|
-
isString(getRowCell)
|
|
159
|
-
? (getCell) => getCell(getRowCell)
|
|
160
|
-
: getRowCell ?? (() => defaultCellValue ?? EMPTY_STRING);
|
|
161
|
-
const getCreateFunction = (getFunction) => {
|
|
162
|
-
const getFunctionsByStore = /* @__PURE__ */ new WeakMap();
|
|
163
|
-
return (store) => {
|
|
164
|
-
if (!getFunctionsByStore.has(store)) {
|
|
165
|
-
getFunctionsByStore.set(store, getFunction(store));
|
|
166
|
-
}
|
|
167
|
-
return getFunctionsByStore.get(store);
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
const addDeepSet = (deepSet, value, ids) =>
|
|
172
|
-
arrayLength(ids) < 2
|
|
173
|
-
? setAdd(
|
|
174
|
-
arrayIsEmpty(ids) ? deepSet : mapEnsure(deepSet, ids[0], setNew()),
|
|
175
|
-
value,
|
|
176
|
-
)
|
|
177
|
-
: addDeepSet(
|
|
178
|
-
mapEnsure(deepSet, ids[0], mapNew()),
|
|
179
|
-
value,
|
|
180
|
-
arrayFromSecond(ids),
|
|
181
|
-
);
|
|
182
|
-
const forDeepSet = (valueDo) => {
|
|
183
|
-
const deep = (deepIdSet, arg, ...ids) =>
|
|
184
|
-
ifNotUndefined(deepIdSet, (deepIdSet2) =>
|
|
185
|
-
arrayIsEmpty(ids)
|
|
186
|
-
? valueDo(deepIdSet2, arg)
|
|
187
|
-
: arrayForEach([ids[0], null], (id) =>
|
|
188
|
-
deep(mapGet(deepIdSet2, id), arg, ...arrayFromSecond(ids)),
|
|
189
|
-
),
|
|
190
|
-
);
|
|
191
|
-
return deep;
|
|
192
|
-
};
|
|
193
|
-
const getListenerFunctions = (getThing) => {
|
|
194
|
-
let thing;
|
|
195
|
-
let nextId = 0;
|
|
196
|
-
const listenerPool = [];
|
|
197
|
-
const allListeners = mapNew();
|
|
198
|
-
const addListener = (listener, deepSet, idOrNulls = []) => {
|
|
199
|
-
thing ??= getThing();
|
|
200
|
-
const id = listenerPool.pop() ?? '' + nextId++;
|
|
201
|
-
mapSet(allListeners, id, [listener, deepSet, idOrNulls]);
|
|
202
|
-
addDeepSet(deepSet, id, idOrNulls);
|
|
203
|
-
return id;
|
|
204
|
-
};
|
|
205
|
-
const callListeners = (deepSet, ids = [], ...extraArgs) =>
|
|
206
|
-
forDeepSet(collForEach)(
|
|
207
|
-
deepSet,
|
|
208
|
-
(id) =>
|
|
209
|
-
ifNotUndefined(mapGet(allListeners, id), ([listener]) =>
|
|
210
|
-
listener(thing, ...ids, ...extraArgs),
|
|
211
|
-
),
|
|
212
|
-
...ids,
|
|
213
|
-
);
|
|
214
|
-
const delListener = (id) =>
|
|
215
|
-
ifNotUndefined(
|
|
216
|
-
mapGet(allListeners, id),
|
|
217
|
-
([, deepSet, idOrNulls]) => {
|
|
218
|
-
forDeepSet(collDel)(deepSet, id, ...idOrNulls);
|
|
219
|
-
mapSet(allListeners, id);
|
|
220
|
-
if (arrayLength(listenerPool) < 1e3) {
|
|
221
|
-
listenerPool.push(id);
|
|
222
|
-
}
|
|
223
|
-
return idOrNulls;
|
|
224
|
-
},
|
|
225
|
-
() => [],
|
|
226
|
-
);
|
|
227
|
-
const callListener = (id, idNullGetters, extraArgsGetter) =>
|
|
228
|
-
ifNotUndefined(mapGet(allListeners, id), ([listener, , idOrNulls]) => {
|
|
229
|
-
const callWithIds = (...ids) => {
|
|
230
|
-
const index = arrayLength(ids);
|
|
231
|
-
index == arrayLength(idOrNulls)
|
|
232
|
-
? listener(thing, ...ids, ...extraArgsGetter(ids))
|
|
233
|
-
: isUndefined(idOrNulls[index])
|
|
234
|
-
? arrayForEach(idNullGetters[index](...ids), (id2) =>
|
|
235
|
-
callWithIds(...ids, id2),
|
|
236
|
-
)
|
|
237
|
-
: callWithIds(...ids, idOrNulls[index]);
|
|
238
|
-
};
|
|
239
|
-
callWithIds();
|
|
240
|
-
});
|
|
241
|
-
return [addListener, callListeners, delListener, callListener];
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
const object = Object;
|
|
245
|
-
const objFreeze = object.freeze;
|
|
246
|
-
|
|
247
|
-
const createIndexes = getCreateFunction((store) => {
|
|
248
|
-
const sliceIdsListeners = mapNew();
|
|
249
|
-
const sliceRowIdsListeners = mapNew();
|
|
250
|
-
const [
|
|
251
|
-
getStore,
|
|
252
|
-
getIndexIds,
|
|
253
|
-
getTableId,
|
|
254
|
-
getIndex,
|
|
255
|
-
setIndex,
|
|
256
|
-
setDefinition,
|
|
257
|
-
delDefinition,
|
|
258
|
-
destroy,
|
|
259
|
-
] = getDefinableFunctions(store, mapNew, (value) =>
|
|
260
|
-
isUndefined(value) ? EMPTY_STRING : value + EMPTY_STRING,
|
|
261
|
-
);
|
|
262
|
-
const [addListener, callListeners, delListenerImpl] = getListenerFunctions(
|
|
263
|
-
() => indexes,
|
|
264
|
-
);
|
|
265
|
-
const setIndexDefinition = (
|
|
266
|
-
indexId,
|
|
267
|
-
tableId,
|
|
268
|
-
getSliceId,
|
|
269
|
-
getSortKey,
|
|
270
|
-
sliceIdSorter,
|
|
271
|
-
rowIdSorter = defaultSorter,
|
|
272
|
-
) => {
|
|
273
|
-
const sliceIdArraySorter = isUndefined(sliceIdSorter)
|
|
274
|
-
? void 0
|
|
275
|
-
: ([id1], [id2]) => sliceIdSorter(id1, id2);
|
|
276
|
-
setDefinition(
|
|
277
|
-
indexId,
|
|
278
|
-
tableId,
|
|
279
|
-
(change, changedSliceIds, changedSortKeys, sliceIds, sortKeys) => {
|
|
280
|
-
let sliceIdsChanged = 0;
|
|
281
|
-
const changedSlices = setNew();
|
|
282
|
-
const unsortedSlices = setNew();
|
|
283
|
-
const index = getIndex(indexId);
|
|
284
|
-
collForEach(changedSliceIds, ([oldSliceId, newSliceId], rowId) => {
|
|
285
|
-
if (!isUndefined(oldSliceId)) {
|
|
286
|
-
setAdd(changedSlices, oldSliceId);
|
|
287
|
-
ifNotUndefined(mapGet(index, oldSliceId), (oldSlice) => {
|
|
288
|
-
collDel(oldSlice, rowId);
|
|
289
|
-
if (collIsEmpty(oldSlice)) {
|
|
290
|
-
mapSet(index, oldSliceId);
|
|
291
|
-
sliceIdsChanged = 1;
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
if (!isUndefined(newSliceId)) {
|
|
296
|
-
setAdd(changedSlices, newSliceId);
|
|
297
|
-
if (!collHas(index, newSliceId)) {
|
|
298
|
-
mapSet(index, newSliceId, setNew());
|
|
299
|
-
sliceIdsChanged = 1;
|
|
300
|
-
}
|
|
301
|
-
setAdd(mapGet(index, newSliceId), rowId);
|
|
302
|
-
if (!isUndefined(getSortKey)) {
|
|
303
|
-
setAdd(unsortedSlices, newSliceId);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
change();
|
|
308
|
-
mapForEach(changedSortKeys, (rowId) =>
|
|
309
|
-
ifNotUndefined(mapGet(sliceIds, rowId), (sliceId) =>
|
|
310
|
-
setAdd(unsortedSlices, sliceId),
|
|
311
|
-
),
|
|
312
|
-
);
|
|
313
|
-
if (!collIsEmpty(sortKeys)) {
|
|
314
|
-
collForEach(unsortedSlices, (sliceId) => {
|
|
315
|
-
const rowIdArraySorter = (rowId1, rowId2) =>
|
|
316
|
-
rowIdSorter(
|
|
317
|
-
mapGet(sortKeys, rowId1),
|
|
318
|
-
mapGet(sortKeys, rowId2),
|
|
319
|
-
sliceId,
|
|
320
|
-
);
|
|
321
|
-
const sliceArray = [...mapGet(index, sliceId)];
|
|
322
|
-
if (!arrayIsSorted(sliceArray, rowIdArraySorter)) {
|
|
323
|
-
mapSet(
|
|
324
|
-
index,
|
|
325
|
-
sliceId,
|
|
326
|
-
setNew(arraySort(sliceArray, rowIdArraySorter)),
|
|
327
|
-
);
|
|
328
|
-
setAdd(changedSlices, sliceId);
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
if (sliceIdsChanged) {
|
|
333
|
-
if (!isUndefined(sliceIdArraySorter)) {
|
|
334
|
-
const indexArray = [...index];
|
|
335
|
-
if (!arrayIsSorted(indexArray, sliceIdArraySorter)) {
|
|
336
|
-
setIndex(
|
|
337
|
-
indexId,
|
|
338
|
-
mapNew(arraySort(indexArray, sliceIdArraySorter)),
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
callListeners(sliceIdsListeners, [indexId]);
|
|
343
|
-
}
|
|
344
|
-
collForEach(changedSlices, (sliceId) =>
|
|
345
|
-
callListeners(sliceRowIdsListeners, [indexId, sliceId]),
|
|
346
|
-
);
|
|
347
|
-
},
|
|
348
|
-
getRowCellFunction(getSliceId),
|
|
349
|
-
ifNotUndefined(getSortKey, getRowCellFunction),
|
|
350
|
-
);
|
|
351
|
-
return indexes;
|
|
352
|
-
};
|
|
353
|
-
const delIndexDefinition = (indexId) => {
|
|
354
|
-
delDefinition(indexId);
|
|
355
|
-
return indexes;
|
|
356
|
-
};
|
|
357
|
-
const getSliceIds = (indexId) => mapKeys(getIndex(indexId));
|
|
358
|
-
const getSliceRowIds = (indexId, sliceId) =>
|
|
359
|
-
collValues(mapGet(getIndex(indexId), sliceId));
|
|
360
|
-
const addSliceIdsListener = (indexId, listener) =>
|
|
361
|
-
addListener(listener, sliceIdsListeners, [indexId]);
|
|
362
|
-
const addSliceRowIdsListener = (indexId, sliceId, listener) =>
|
|
363
|
-
addListener(listener, sliceRowIdsListeners, [indexId, sliceId]);
|
|
364
|
-
const delListener = (listenerId) => {
|
|
365
|
-
delListenerImpl(listenerId);
|
|
366
|
-
return indexes;
|
|
367
|
-
};
|
|
368
|
-
const getListenerStats = () => ({
|
|
369
|
-
sliceIds: collSize2(sliceIdsListeners),
|
|
370
|
-
sliceRowIds: collSize3(sliceRowIdsListeners),
|
|
371
|
-
});
|
|
372
|
-
const indexes = {
|
|
373
|
-
setIndexDefinition,
|
|
374
|
-
delIndexDefinition,
|
|
375
|
-
getStore,
|
|
376
|
-
getIndexIds,
|
|
377
|
-
getTableId,
|
|
378
|
-
getSliceIds,
|
|
379
|
-
getSliceRowIds,
|
|
380
|
-
addSliceIdsListener,
|
|
381
|
-
addSliceRowIdsListener,
|
|
382
|
-
delListener,
|
|
383
|
-
destroy,
|
|
384
|
-
getListenerStats,
|
|
385
|
-
};
|
|
386
|
-
return objFreeze(indexes);
|
|
387
|
-
});
|
|
388
|
-
const defaultSorter = (sortKey1, sortKey2) => (sortKey1 < sortKey2 ? -1 : 1);
|
|
389
|
-
|
|
390
|
-
export {createIndexes, defaultSorter};
|