@akanjs/store 0.9.57 → 0.9.58-canary.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/cjs/src/baseSt.js
CHANGED
|
@@ -764,10 +764,11 @@ const makeActions = (refName, slices) => {
|
|
|
764
764
|
});
|
|
765
765
|
},
|
|
766
766
|
[namesOfSlice.setQueryArgsOfModel]: async function(...args) {
|
|
767
|
-
const
|
|
768
|
-
const options = args[argLength];
|
|
767
|
+
const isSetQueryAsFunction = typeof args[0] === "function";
|
|
769
768
|
const currentState = this.get();
|
|
769
|
+
const options = isSetQueryAsFunction ? args[1] : args[argLength];
|
|
770
770
|
const queryArgsOfModel = currentState[namesOfSlice.queryArgsOfModel];
|
|
771
|
+
const queryArgs = isSetQueryAsFunction ? args[0](...queryArgsOfModel) : new Array(argLength).fill(null).map((_, i) => args[i]);
|
|
771
772
|
const limitOfModel = currentState[namesOfSlice.limitOfModel];
|
|
772
773
|
const sortOfModel = currentState[namesOfSlice.sortOfModel];
|
|
773
774
|
if ((0, import_common.isQueryEqual)(queryArgsOfModel, queryArgs)) {
|
package/esm/src/baseSt.js
CHANGED
|
@@ -751,10 +751,11 @@ const makeActions = (refName, slices) => {
|
|
|
751
751
|
});
|
|
752
752
|
},
|
|
753
753
|
[namesOfSlice.setQueryArgsOfModel]: async function(...args) {
|
|
754
|
-
const
|
|
755
|
-
const options = args[argLength];
|
|
754
|
+
const isSetQueryAsFunction = typeof args[0] === "function";
|
|
756
755
|
const currentState = this.get();
|
|
756
|
+
const options = isSetQueryAsFunction ? args[1] : args[argLength];
|
|
757
757
|
const queryArgsOfModel = currentState[namesOfSlice.queryArgsOfModel];
|
|
758
|
+
const queryArgs = isSetQueryAsFunction ? args[0](...queryArgsOfModel) : new Array(argLength).fill(null).map((_, i) => args[i]);
|
|
758
759
|
const limitOfModel = currentState[namesOfSlice.limitOfModel];
|
|
759
760
|
const sortOfModel = currentState[namesOfSlice.sortOfModel];
|
|
760
761
|
if (isQueryEqual(queryArgsOfModel, queryArgs)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/store",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.58-canary.1",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"node": ">=20"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"react": "19.
|
|
18
|
+
"react": "19.2.0",
|
|
19
19
|
"zustand": "^5.0.2"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
package/src/baseSt.d.ts
CHANGED
|
@@ -33,9 +33,6 @@ declare const RootStore_base: new (...args: any[]) => import("./storeDecorators"
|
|
|
33
33
|
keyboardHeight: number;
|
|
34
34
|
pageState: import("@akanjs/client").PageState;
|
|
35
35
|
devMode: boolean;
|
|
36
|
-
getSelf: ({ reset }?: {
|
|
37
|
-
reset?: boolean;
|
|
38
|
-
}) => Promise<void>;
|
|
39
36
|
deviceToken: string;
|
|
40
37
|
currentPath: string;
|
|
41
38
|
}, {}, {}>;
|
package/src/storeDecorators.d.ts
CHANGED
|
@@ -158,7 +158,7 @@ type SliceAction<T extends string, Input, Full extends {
|
|
|
158
158
|
} & {
|
|
159
159
|
[K in `setLimitOf${_CapitalizedT}`]: (limit: number, options?: FetchPolicy) => Promise<void>;
|
|
160
160
|
} & {
|
|
161
|
-
[K in `setQueryArgsOf${_CapitalizedT}`]: (...args: [...args: QueryArgs, options?: FetchPolicy]) => Promise<void>;
|
|
161
|
+
[K in `setQueryArgsOf${_CapitalizedT}`]: (...args: [...args: QueryArgs, options?: FetchPolicy] | [setQueryArgs: (...prevQueryArgs: QueryArgs) => QueryArgs, options?: FetchPolicy]) => Promise<void>;
|
|
162
162
|
} & {
|
|
163
163
|
[K in `setSortOf${_CapitalizedT}`]: (sort: _Sort, options?: FetchPolicy) => Promise<void>;
|
|
164
164
|
};
|