@legendapp/state 3.0.0-beta.27 → 3.0.0-beta.28
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/package.json +1 -1
- package/sync-plugins/keel.d.mts +3 -0
- package/sync-plugins/keel.d.ts +3 -0
- package/sync-plugins/keel.js +8 -11
- package/sync-plugins/keel.mjs +8 -11
package/package.json
CHANGED
package/sync-plugins/keel.d.mts
CHANGED
|
@@ -50,6 +50,9 @@ interface KeelClient {
|
|
|
50
50
|
api: {
|
|
51
51
|
queries: Record<string, (i: any) => Promise<any>>;
|
|
52
52
|
};
|
|
53
|
+
client: {
|
|
54
|
+
rawRequest: <T>(action: string, body: any) => Promise<APIResult<T>>;
|
|
55
|
+
};
|
|
53
56
|
}
|
|
54
57
|
interface SyncedKeelPropsManyBase<TRemote extends {
|
|
55
58
|
id: string;
|
package/sync-plugins/keel.d.ts
CHANGED
|
@@ -50,6 +50,9 @@ interface KeelClient {
|
|
|
50
50
|
api: {
|
|
51
51
|
queries: Record<string, (i: any) => Promise<any>>;
|
|
52
52
|
};
|
|
53
|
+
client: {
|
|
54
|
+
rawRequest: <T>(action: string, body: any) => Promise<APIResult<T>>;
|
|
55
|
+
};
|
|
53
56
|
}
|
|
54
57
|
interface SyncedKeelPropsManyBase<TRemote extends {
|
|
55
58
|
id: string;
|
package/sync-plugins/keel.js
CHANGED
|
@@ -79,19 +79,16 @@ function setupRealtime(props) {
|
|
|
79
79
|
const { client } = props;
|
|
80
80
|
if (client && !modifiedClients.has(client)) {
|
|
81
81
|
modifiedClients.add(client);
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
lastAction: key,
|
|
89
|
-
lastParams: i
|
|
90
|
-
};
|
|
91
|
-
return origFn(i);
|
|
82
|
+
const originalRawRequest = client.client.rawRequest;
|
|
83
|
+
client.client.rawRequest = (action, body) => {
|
|
84
|
+
if (action.startsWith("list")) {
|
|
85
|
+
realtimeState.current = {
|
|
86
|
+
lastAction: action,
|
|
87
|
+
lastParams: body
|
|
92
88
|
};
|
|
93
89
|
}
|
|
94
|
-
|
|
90
|
+
return originalRawRequest(action, body);
|
|
91
|
+
};
|
|
95
92
|
}
|
|
96
93
|
}
|
|
97
94
|
var NumPerPage = 200;
|
package/sync-plugins/keel.mjs
CHANGED
|
@@ -77,19 +77,16 @@ function setupRealtime(props) {
|
|
|
77
77
|
const { client } = props;
|
|
78
78
|
if (client && !modifiedClients.has(client)) {
|
|
79
79
|
modifiedClients.add(client);
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
lastAction: key,
|
|
87
|
-
lastParams: i
|
|
88
|
-
};
|
|
89
|
-
return origFn(i);
|
|
80
|
+
const originalRawRequest = client.client.rawRequest;
|
|
81
|
+
client.client.rawRequest = (action, body) => {
|
|
82
|
+
if (action.startsWith("list")) {
|
|
83
|
+
realtimeState.current = {
|
|
84
|
+
lastAction: action,
|
|
85
|
+
lastParams: body
|
|
90
86
|
};
|
|
91
87
|
}
|
|
92
|
-
|
|
88
|
+
return originalRawRequest(action, body);
|
|
89
|
+
};
|
|
93
90
|
}
|
|
94
91
|
}
|
|
95
92
|
var NumPerPage = 200;
|