tsdf 8.0.0-beta.5 → 8.0.0-beta.7
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/main.cjs +2 -2
- package/dist/main.d.ts +6 -6
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -33,7 +33,7 @@ __export(main_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(main_exports);
|
|
34
34
|
|
|
35
35
|
// src/documentStore.ts
|
|
36
|
-
var import_immer =
|
|
36
|
+
var import_immer = require("immer");
|
|
37
37
|
var import_mitt2 = __toESM(require("mitt"), 1);
|
|
38
38
|
var import_react3 = require("react");
|
|
39
39
|
var import_t_state2 = require("t-state");
|
|
@@ -524,7 +524,7 @@ function newTSDFDocumentStore({
|
|
|
524
524
|
(current) => {
|
|
525
525
|
if (!current)
|
|
526
526
|
return current;
|
|
527
|
-
return (0, import_immer.
|
|
527
|
+
return (0, import_immer.produce)(current, produceNewData);
|
|
528
528
|
},
|
|
529
529
|
{ action: "update-state" }
|
|
530
530
|
);
|
package/dist/main.d.ts
CHANGED
|
@@ -153,7 +153,7 @@ type TSFDUseListQueryReturn<Selected, ItemPayload, NError> = {
|
|
|
153
153
|
hasMore: boolean;
|
|
154
154
|
isLoading: boolean;
|
|
155
155
|
};
|
|
156
|
-
type
|
|
156
|
+
type TSFDUseListItemReturn<Selected, NError, ItemPayload> = {
|
|
157
157
|
data: Selected;
|
|
158
158
|
status: QueryStatus | 'idle' | 'deleted';
|
|
159
159
|
payload: ItemPayload | null;
|
|
@@ -249,23 +249,23 @@ declare function newTSDFListQueryStore<ItemState extends ValidStoreState, NError
|
|
|
249
249
|
loadSize?: number | undefined;
|
|
250
250
|
}) => TSFDUseListQueryReturn<SelectedItem_1, QueryPayload, NError>;
|
|
251
251
|
getItemKey: (params: ItemPayload) => string;
|
|
252
|
-
useItem: <SelectedItem_2 = ItemState>(itemPayload: ItemPayload | false | null | undefined, options?: {
|
|
252
|
+
useItem: <SelectedItem_2 = ItemState | null>(itemPayload: ItemPayload | false | null | undefined, options?: {
|
|
253
253
|
selector?: ((data: ItemState | null, id: string) => SelectedItem_2) | undefined;
|
|
254
254
|
disableRefetchOnMount?: boolean | undefined;
|
|
255
255
|
returnIdleStatus?: boolean | undefined;
|
|
256
256
|
returnRefetchingStatus?: boolean | undefined;
|
|
257
257
|
ensureIsLoaded?: boolean | undefined;
|
|
258
|
-
}) =>
|
|
259
|
-
useMultipleItems: <SelectedItem_3 = ItemState>(itemsPayload_: ItemPayload[], { selector, returnIdleStatus, returnRefetchingStatus, disableRefetchOnMount, }?: {
|
|
258
|
+
}) => TSFDUseListItemReturn<SelectedItem_2, NError, ItemPayload>;
|
|
259
|
+
useMultipleItems: <SelectedItem_3 = ItemState | null>(itemsPayload_: ItemPayload[], { selector, returnIdleStatus, returnRefetchingStatus, disableRefetchOnMount, }?: {
|
|
260
260
|
selector?: ((data: ItemState | null, id: string) => SelectedItem_3) | undefined;
|
|
261
261
|
disableRefetchOnMount?: boolean | undefined;
|
|
262
262
|
returnIdleStatus?: boolean | undefined;
|
|
263
263
|
returnRefetchingStatus?: boolean | undefined;
|
|
264
|
-
}) => readonly
|
|
264
|
+
}) => readonly TSFDUseListItemReturn<SelectedItem_3, NError, ItemPayload>[];
|
|
265
265
|
addItemToState: (itemPayload: ItemPayload, data: ItemState) => void;
|
|
266
266
|
updateItemState: (itemIds: ItemPayload | ((ItemPayload: ItemPayload, itemState: ItemState) => boolean) | ItemPayload[], produceNewData: (draftData: ItemState, itemPayload: ItemPayload) => void | ItemState, ifNothingWasUpdated?: () => void) => boolean;
|
|
267
267
|
startItemMutation: (itemId: ItemPayload | ((ItemPayload: ItemPayload, itemState: ItemState) => boolean) | ItemPayload[]) => () => void;
|
|
268
268
|
};
|
|
269
269
|
type TSFDListQueryStore<ItemState extends ValidStoreState, NError, QueryPayload extends ValidPayload, ItemPayload extends ValidPayload> = ReturnType<typeof newTSDFListQueryStore<ItemState, NError, QueryPayload, ItemPayload>>;
|
|
270
270
|
|
|
271
|
-
export { FetchListFnReturn, TSDFCollectionStore, TSDFDocumentStore, TSDFDocumentStoreState, TSDFItemQuery, TSDFStatus, TSDFUseDocumentReturn, TSFDCollectionItem, TSFDCollectionState, TSFDListQuery, TSFDListQueryState, TSFDListQueryStore, TSFDUseCollectionItemReturn,
|
|
271
|
+
export { FetchListFnReturn, TSDFCollectionStore, TSDFDocumentStore, TSDFDocumentStoreState, TSDFItemQuery, TSDFStatus, TSDFUseDocumentReturn, TSFDCollectionItem, TSFDCollectionState, TSFDListQuery, TSFDListQueryState, TSFDListQueryStore, TSFDUseCollectionItemReturn, TSFDUseListItemReturn, TSFDUseListQueryReturn, ValidPayload, ValidStoreState, newTSDFCollectionStore, newTSDFDocumentStore, newTSDFListQueryStore };
|
package/dist/main.js
CHANGED