floppy-disk 3.5.0 → 3.5.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/README.md +2 -0
- package/esm/react/create-mutation.d.mts +2 -2
- package/esm/react/create-query.d.mts +2 -2
- package/esm/react/create-stores.d.mts +1 -1
- package/esm/vanilla/store.d.mts +2 -9
- package/package.json +1 -1
- package/react/create-mutation.d.ts +2 -2
- package/react/create-query.d.ts +2 -2
- package/react/create-stores.d.ts +1 -1
- package/vanilla/store.d.ts +2 -9
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type InitStoreOptions, type
|
|
1
|
+
import { type InitStoreOptions, type SetStateInput } from "../vanilla.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* Represents the state of a mutation.
|
|
4
4
|
*
|
|
@@ -118,7 +118,7 @@ export declare const createMutation: <TData, TVariable = undefined, TError = Err
|
|
|
118
118
|
* - Intended for advanced use cases.
|
|
119
119
|
* - Prefer using provided mutation actions (`execute`, `reset`) instead.
|
|
120
120
|
*/
|
|
121
|
-
setState: (value:
|
|
121
|
+
setState: (value: SetStateInput<MutationState<TData, TVariable, TError>>) => void;
|
|
122
122
|
/**
|
|
123
123
|
* Executes the mutation.
|
|
124
124
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type InitStoreOptions, type
|
|
1
|
+
import { type InitStoreOptions, type SetStateInput } from "../vanilla.mjs";
|
|
2
2
|
import type { StoreKey } from "./create-stores.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Represents the state of a query.
|
|
@@ -347,7 +347,7 @@ export declare const createQuery: <TData, TVariable extends StoreKey = never, TE
|
|
|
347
347
|
subscribe: (subscriber: import("../vanilla.d.mts").Subscriber<QueryState<TData, TError>>) => () => void;
|
|
348
348
|
getSubscribers: () => Set<import("../vanilla.d.mts").Subscriber<QueryState<TData, TError>>>;
|
|
349
349
|
getState: () => QueryState<TData, TError>;
|
|
350
|
-
setState: (value:
|
|
350
|
+
setState: (value: SetStateInput<QueryState<TData, TError>>) => void;
|
|
351
351
|
}) & {
|
|
352
352
|
/**
|
|
353
353
|
* Executes all query instances.
|
|
@@ -48,7 +48,7 @@ export declare const createStores: <TState extends Record<string, any>, TKey ext
|
|
|
48
48
|
initialState?: Partial<TState>;
|
|
49
49
|
}) => TState) & {
|
|
50
50
|
delete: () => boolean;
|
|
51
|
-
setState: (value: import("../vanilla.d.mts").
|
|
51
|
+
setState: (value: import("../vanilla.d.mts").SetStateInput<TState>) => void;
|
|
52
52
|
getState: () => TState;
|
|
53
53
|
subscribe: (subscriber: import("../vanilla.d.mts").Subscriber<TState>) => () => void;
|
|
54
54
|
getSubscribers: () => Set<import("../vanilla.d.mts").Subscriber<TState>>;
|
package/esm/vanilla/store.d.mts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Represents a partial state update.
|
|
3
|
-
*
|
|
4
|
-
* Can be either:
|
|
5
|
-
* - A partial object to merge into the current state
|
|
6
|
-
* - A function that receives the current state and returns a partial update
|
|
7
|
-
*/
|
|
8
|
-
export type SetState<TState> = Partial<TState> | ((state: TState) => Partial<TState>);
|
|
1
|
+
export type SetStateInput<TState> = Partial<TState> | ((state: TState) => Partial<TState>);
|
|
9
2
|
/**
|
|
10
3
|
* A subscriber function that is called whenever the state updates.
|
|
11
4
|
*
|
|
@@ -30,7 +23,7 @@ export type Subscriber<TState> = (state: TState, prevState: TState, changedKeys:
|
|
|
30
23
|
* - By default, `setState` is **disabled on the server** to prevent accidental shared state between requests.
|
|
31
24
|
*/
|
|
32
25
|
export type StoreApi<TState extends Record<string, any>> = {
|
|
33
|
-
setState: (value:
|
|
26
|
+
setState: (value: SetStateInput<TState>) => void;
|
|
34
27
|
getState: () => TState;
|
|
35
28
|
subscribe: (subscriber: Subscriber<TState>) => () => void;
|
|
36
29
|
getSubscribers: () => Set<Subscriber<TState>>;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type InitStoreOptions, type
|
|
1
|
+
import { type InitStoreOptions, type SetStateInput } from "../vanilla.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Represents the state of a mutation.
|
|
4
4
|
*
|
|
@@ -118,7 +118,7 @@ export declare const createMutation: <TData, TVariable = undefined, TError = Err
|
|
|
118
118
|
* - Intended for advanced use cases.
|
|
119
119
|
* - Prefer using provided mutation actions (`execute`, `reset`) instead.
|
|
120
120
|
*/
|
|
121
|
-
setState: (value:
|
|
121
|
+
setState: (value: SetStateInput<MutationState<TData, TVariable, TError>>) => void;
|
|
122
122
|
/**
|
|
123
123
|
* Executes the mutation.
|
|
124
124
|
*
|
package/react/create-query.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type InitStoreOptions, type
|
|
1
|
+
import { type InitStoreOptions, type SetStateInput } from "../vanilla.ts";
|
|
2
2
|
import type { StoreKey } from "./create-stores.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Represents the state of a query.
|
|
@@ -347,7 +347,7 @@ export declare const createQuery: <TData, TVariable extends StoreKey = never, TE
|
|
|
347
347
|
subscribe: (subscriber: import("../vanilla.ts").Subscriber<QueryState<TData, TError>>) => () => void;
|
|
348
348
|
getSubscribers: () => Set<import("../vanilla.ts").Subscriber<QueryState<TData, TError>>>;
|
|
349
349
|
getState: () => QueryState<TData, TError>;
|
|
350
|
-
setState: (value:
|
|
350
|
+
setState: (value: SetStateInput<QueryState<TData, TError>>) => void;
|
|
351
351
|
}) & {
|
|
352
352
|
/**
|
|
353
353
|
* Executes all query instances.
|
package/react/create-stores.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export declare const createStores: <TState extends Record<string, any>, TKey ext
|
|
|
48
48
|
initialState?: Partial<TState>;
|
|
49
49
|
}) => TState) & {
|
|
50
50
|
delete: () => boolean;
|
|
51
|
-
setState: (value: import("../vanilla.ts").
|
|
51
|
+
setState: (value: import("../vanilla.ts").SetStateInput<TState>) => void;
|
|
52
52
|
getState: () => TState;
|
|
53
53
|
subscribe: (subscriber: import("../vanilla.ts").Subscriber<TState>) => () => void;
|
|
54
54
|
getSubscribers: () => Set<import("../vanilla.ts").Subscriber<TState>>;
|
package/vanilla/store.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Represents a partial state update.
|
|
3
|
-
*
|
|
4
|
-
* Can be either:
|
|
5
|
-
* - A partial object to merge into the current state
|
|
6
|
-
* - A function that receives the current state and returns a partial update
|
|
7
|
-
*/
|
|
8
|
-
export type SetState<TState> = Partial<TState> | ((state: TState) => Partial<TState>);
|
|
1
|
+
export type SetStateInput<TState> = Partial<TState> | ((state: TState) => Partial<TState>);
|
|
9
2
|
/**
|
|
10
3
|
* A subscriber function that is called whenever the state updates.
|
|
11
4
|
*
|
|
@@ -30,7 +23,7 @@ export type Subscriber<TState> = (state: TState, prevState: TState, changedKeys:
|
|
|
30
23
|
* - By default, `setState` is **disabled on the server** to prevent accidental shared state between requests.
|
|
31
24
|
*/
|
|
32
25
|
export type StoreApi<TState extends Record<string, any>> = {
|
|
33
|
-
setState: (value:
|
|
26
|
+
setState: (value: SetStateInput<TState>) => void;
|
|
34
27
|
getState: () => TState;
|
|
35
28
|
subscribe: (subscriber: Subscriber<TState>) => () => void;
|
|
36
29
|
getSubscribers: () => Set<Subscriber<TState>>;
|