tinybase 2.0.0-beta.0 → 2.0.0-beta.1
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/lib/debug/queries.d.ts +5 -17
- package/lib/debug/queries.js +3 -6
- package/lib/debug/tinybase.js +3 -6
- package/lib/debug/ui-react.d.ts +1958 -196
- package/lib/debug/ui-react.js +189 -4
- package/lib/queries.d.ts +5 -17
- package/lib/queries.js +1 -1
- package/lib/queries.js.gz +0 -0
- package/lib/tinybase.js +1 -1
- package/lib/tinybase.js.gz +0 -0
- package/lib/ui-react.d.ts +1958 -196
- package/lib/ui-react.js +1 -1
- package/lib/ui-react.js.gz +0 -0
- package/lib/umd/queries.js +1 -1
- package/lib/umd/queries.js.gz +0 -0
- package/lib/umd/tinybase.js +1 -1
- package/lib/umd/tinybase.js.gz +0 -0
- package/lib/umd/ui-react.js +1 -1
- package/lib/umd/ui-react.js.gz +0 -0
- package/package.json +1 -1
- package/readme.md +1 -1
package/lib/debug/queries.d.ts
CHANGED
|
@@ -1323,8 +1323,6 @@ export type Having = {
|
|
|
1323
1323
|
* optional `trackReorder` parameter to `true` to track when the set of Ids has
|
|
1324
1324
|
* not changed, but the order has.
|
|
1325
1325
|
*
|
|
1326
|
-
* trackReorder
|
|
1327
|
-
*
|
|
1328
1326
|
* @example
|
|
1329
1327
|
* This example shows a query that orders a Table by a numeric Cell, in a
|
|
1330
1328
|
* descending fashion.
|
|
@@ -2438,7 +2436,7 @@ export interface Queries {
|
|
|
2438
2436
|
* a `null` wildcard).
|
|
2439
2437
|
*
|
|
2440
2438
|
* Use the optional `trackReorder` parameter to additionally track when the
|
|
2441
|
-
* set of Ids has not changed, but the order has -
|
|
2439
|
+
* set of Ids has not changed, but the order has - specifically when the Order
|
|
2442
2440
|
* clause of the query causes the Row Ids to be re-sorted. This behavior is
|
|
2443
2441
|
* disabled by default due to the potential performance cost of detecting such
|
|
2444
2442
|
* changes.
|
|
@@ -2685,33 +2683,24 @@ export interface Queries {
|
|
|
2685
2683
|
* called with a reference to the Queries object, the Id of the Table (which
|
|
2686
2684
|
* is also the query Id), and the Id of the result Row that changed.
|
|
2687
2685
|
*
|
|
2688
|
-
*
|
|
2689
|
-
*
|
|
2690
|
-
*
|
|
2686
|
+
* Such a listener is only called when a Cell is added to, or removed from,
|
|
2687
|
+
* the result Row. To listen to all changes in the result Row, use the
|
|
2688
|
+
* addResultRowListener method.
|
|
2691
2689
|
*
|
|
2692
2690
|
* You can either listen to a single result Row (by specifying the query Id
|
|
2693
2691
|
* and Row Id as the method's first two parameters) or changes to any Row (by
|
|
2694
|
-
* providing `null`).
|
|
2692
|
+
* providing `null` wildcards).
|
|
2695
2693
|
*
|
|
2696
2694
|
* Both, either, or neither of the `queryId` and `rowId` parameters can be
|
|
2697
2695
|
* wildcarded with `null`. You can listen to a specific result Row in a
|
|
2698
2696
|
* specific query, any result Row in a specific query, a specific result Row
|
|
2699
2697
|
* in any query, or any result Row in any query.
|
|
2700
2698
|
*
|
|
2701
|
-
* Use the optional `trackReorder` parameter to additionally track when the
|
|
2702
|
-
* set of Ids has not changed, but the order has - for example when a Cell
|
|
2703
|
-
* from the middle of the Row is removed and then added back within the same
|
|
2704
|
-
* transaction. This behavior is disabled by default due to the potential
|
|
2705
|
-
* performance cost of detecting such changes.
|
|
2706
|
-
*
|
|
2707
2699
|
* @param queryId The Id of the query to listen to, or `null` as a wildcard.
|
|
2708
2700
|
* @param rowId The Id of the result Row to listen to, or `null` as a
|
|
2709
2701
|
* wildcard.
|
|
2710
2702
|
* @param listener The function that will be called whenever the Cell Ids in
|
|
2711
2703
|
* the result Row change.
|
|
2712
|
-
* @param trackReorder An optional boolean that indicates that the listener
|
|
2713
|
-
* should be called if the set of Ids remains the same but their order
|
|
2714
|
-
* changes.
|
|
2715
2704
|
* @returns A unique Id for the listener that can later be used to remove it.
|
|
2716
2705
|
* @example
|
|
2717
2706
|
* This example registers a listener that responds to any change to the Cell
|
|
@@ -2795,7 +2784,6 @@ export interface Queries {
|
|
|
2795
2784
|
queryId: IdOrNull,
|
|
2796
2785
|
rowId: IdOrNull,
|
|
2797
2786
|
listener: ResultCellIdsListener,
|
|
2798
|
-
trackReorder?: boolean,
|
|
2799
2787
|
): Id;
|
|
2800
2788
|
|
|
2801
2789
|
/**
|
package/lib/debug/queries.js
CHANGED
|
@@ -825,12 +825,9 @@ const createQueries = getCreateFunction((store) => {
|
|
|
825
825
|
resultStore.addRowListener(queryId, rowId, (_store, ...args) =>
|
|
826
826
|
listener(queries, ...args),
|
|
827
827
|
);
|
|
828
|
-
const addResultCellIdsListener = (queryId, rowId, listener
|
|
829
|
-
resultStore.addCellIdsListener(
|
|
830
|
-
|
|
831
|
-
rowId,
|
|
832
|
-
(_store, ...args) => listener(queries, ...args),
|
|
833
|
-
trackReorder,
|
|
828
|
+
const addResultCellIdsListener = (queryId, rowId, listener) =>
|
|
829
|
+
resultStore.addCellIdsListener(queryId, rowId, (_store, ...args) =>
|
|
830
|
+
listener(queries, ...args),
|
|
834
831
|
);
|
|
835
832
|
const addResultCellListener = (queryId, rowId, cellId, listener) =>
|
|
836
833
|
resultStore.addCellListener(queryId, rowId, cellId, (_store, ...args) =>
|
package/lib/debug/tinybase.js
CHANGED
|
@@ -1593,12 +1593,9 @@ const createQueries = getCreateFunction((store) => {
|
|
|
1593
1593
|
resultStore.addRowListener(queryId, rowId, (_store, ...args) =>
|
|
1594
1594
|
listener(queries, ...args),
|
|
1595
1595
|
);
|
|
1596
|
-
const addResultCellIdsListener = (queryId, rowId, listener
|
|
1597
|
-
resultStore.addCellIdsListener(
|
|
1598
|
-
|
|
1599
|
-
rowId,
|
|
1600
|
-
(_store, ...args) => listener(queries, ...args),
|
|
1601
|
-
trackReorder,
|
|
1596
|
+
const addResultCellIdsListener = (queryId, rowId, listener) =>
|
|
1597
|
+
resultStore.addCellIdsListener(queryId, rowId, (_store, ...args) =>
|
|
1598
|
+
listener(queries, ...args),
|
|
1602
1599
|
);
|
|
1603
1600
|
const addResultCellListener = (queryId, rowId, cellId, listener) =>
|
|
1604
1601
|
resultStore.addCellListener(queryId, rowId, cellId, (_store, ...args) =>
|