@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
@@ -55,8 +55,6 @@ class RootStore extends (0, import_storeDecorators.store)("root", {
55
55
  keyboardHeight: 0,
56
56
  pageState: import_client.defaultPageState,
57
57
  devMode: false,
58
- getSelf: async ({ reset } = {}) => {
59
- },
60
58
  deviceToken: "",
61
59
  currentPath: ""
62
60
  }) {
@@ -764,10 +764,11 @@ const makeActions = (refName, slices) => {
764
764
  });
765
765
  },
766
766
  [namesOfSlice.setQueryArgsOfModel]: async function(...args) {
767
- const queryArgs = new Array(argLength).fill(null).map((_, i) => args[i]);
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
@@ -31,8 +31,6 @@ class RootStore extends store("root", {
31
31
  keyboardHeight: 0,
32
32
  pageState: defaultPageState,
33
33
  devMode: false,
34
- getSelf: async ({ reset } = {}) => {
35
- },
36
34
  deviceToken: "",
37
35
  currentPath: ""
38
36
  }) {
@@ -751,10 +751,11 @@ const makeActions = (refName, slices) => {
751
751
  });
752
752
  },
753
753
  [namesOfSlice.setQueryArgsOfModel]: async function(...args) {
754
- const queryArgs = new Array(argLength).fill(null).map((_, i) => args[i]);
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.57",
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.1.1",
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
  }, {}, {}>;
@@ -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
  };