@spoosh/react 0.7.3 → 0.7.5
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/index.js +8 -8
- package/dist/index.mjs +8 -8
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ function createUseRead(options) {
|
|
|
40
40
|
tags,
|
|
41
41
|
...pluginOpts
|
|
42
42
|
} = readOptions ?? {};
|
|
43
|
-
const
|
|
43
|
+
const instanceId = (0, import_react.useId)();
|
|
44
44
|
const selectorResultRef = (0, import_react.useRef)({
|
|
45
45
|
call: null,
|
|
46
46
|
selector: null
|
|
@@ -83,7 +83,7 @@ function createUseRead(options) {
|
|
|
83
83
|
stateManager,
|
|
84
84
|
eventEmitter,
|
|
85
85
|
pluginExecutor,
|
|
86
|
-
|
|
86
|
+
instanceId,
|
|
87
87
|
fetchFn: async (fetchOpts) => {
|
|
88
88
|
const pathMethods = api(capturedCall.path);
|
|
89
89
|
const method = pathMethods[capturedCall.method];
|
|
@@ -214,7 +214,7 @@ function createUseRead(options) {
|
|
|
214
214
|
stateManager,
|
|
215
215
|
eventEmitter,
|
|
216
216
|
pluginExecutor,
|
|
217
|
-
|
|
217
|
+
instanceId,
|
|
218
218
|
fetchFn: async (fetchOpts) => {
|
|
219
219
|
const pathMethods = api(capturedCall.path);
|
|
220
220
|
const method = pathMethods[capturedCall.method];
|
|
@@ -256,7 +256,7 @@ function createUseRead(options) {
|
|
|
256
256
|
stateManager,
|
|
257
257
|
eventEmitter,
|
|
258
258
|
pluginExecutor,
|
|
259
|
-
|
|
259
|
+
instanceId,
|
|
260
260
|
pluginOpts,
|
|
261
261
|
api
|
|
262
262
|
]
|
|
@@ -299,7 +299,7 @@ var import_core2 = require("@spoosh/core");
|
|
|
299
299
|
function createUseWrite(options) {
|
|
300
300
|
const { api, stateManager, pluginExecutor, eventEmitter } = options;
|
|
301
301
|
function useWrite(writeFn) {
|
|
302
|
-
const
|
|
302
|
+
const instanceId = (0, import_react2.useId)();
|
|
303
303
|
const selectorResultRef = (0, import_react2.useRef)({
|
|
304
304
|
call: null,
|
|
305
305
|
selector: null
|
|
@@ -331,7 +331,7 @@ function createUseWrite(options) {
|
|
|
331
331
|
stateManager,
|
|
332
332
|
eventEmitter,
|
|
333
333
|
pluginExecutor,
|
|
334
|
-
|
|
334
|
+
instanceId,
|
|
335
335
|
fetchFn: async (fetchOpts) => {
|
|
336
336
|
const pathMethods = api(selectedEndpoint.path);
|
|
337
337
|
const method = pathMethods[selectedEndpoint.method];
|
|
@@ -423,7 +423,7 @@ function createUseInfiniteRead(options) {
|
|
|
423
423
|
prevPageRequest,
|
|
424
424
|
...pluginOpts
|
|
425
425
|
} = readOptions;
|
|
426
|
-
const
|
|
426
|
+
const instanceId = (0, import_react3.useId)();
|
|
427
427
|
const selectorResultRef = (0, import_react3.useRef)({
|
|
428
428
|
call: null,
|
|
429
429
|
selector: null
|
|
@@ -485,7 +485,7 @@ function createUseInfiniteRead(options) {
|
|
|
485
485
|
stateManager,
|
|
486
486
|
eventEmitter,
|
|
487
487
|
pluginExecutor,
|
|
488
|
-
|
|
488
|
+
instanceId,
|
|
489
489
|
fetchFn: async (opts, signal) => {
|
|
490
490
|
const pathMethods = api(capturedCall.path);
|
|
491
491
|
const method = pathMethods[capturedCall.method];
|
package/dist/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ function createUseRead(options) {
|
|
|
24
24
|
tags,
|
|
25
25
|
...pluginOpts
|
|
26
26
|
} = readOptions ?? {};
|
|
27
|
-
const
|
|
27
|
+
const instanceId = useId();
|
|
28
28
|
const selectorResultRef = useRef({
|
|
29
29
|
call: null,
|
|
30
30
|
selector: null
|
|
@@ -67,7 +67,7 @@ function createUseRead(options) {
|
|
|
67
67
|
stateManager,
|
|
68
68
|
eventEmitter,
|
|
69
69
|
pluginExecutor,
|
|
70
|
-
|
|
70
|
+
instanceId,
|
|
71
71
|
fetchFn: async (fetchOpts) => {
|
|
72
72
|
const pathMethods = api(capturedCall.path);
|
|
73
73
|
const method = pathMethods[capturedCall.method];
|
|
@@ -198,7 +198,7 @@ function createUseRead(options) {
|
|
|
198
198
|
stateManager,
|
|
199
199
|
eventEmitter,
|
|
200
200
|
pluginExecutor,
|
|
201
|
-
|
|
201
|
+
instanceId,
|
|
202
202
|
fetchFn: async (fetchOpts) => {
|
|
203
203
|
const pathMethods = api(capturedCall.path);
|
|
204
204
|
const method = pathMethods[capturedCall.method];
|
|
@@ -240,7 +240,7 @@ function createUseRead(options) {
|
|
|
240
240
|
stateManager,
|
|
241
241
|
eventEmitter,
|
|
242
242
|
pluginExecutor,
|
|
243
|
-
|
|
243
|
+
instanceId,
|
|
244
244
|
pluginOpts,
|
|
245
245
|
api
|
|
246
246
|
]
|
|
@@ -294,7 +294,7 @@ import {
|
|
|
294
294
|
function createUseWrite(options) {
|
|
295
295
|
const { api, stateManager, pluginExecutor, eventEmitter } = options;
|
|
296
296
|
function useWrite(writeFn) {
|
|
297
|
-
const
|
|
297
|
+
const instanceId = useId2();
|
|
298
298
|
const selectorResultRef = useRef2({
|
|
299
299
|
call: null,
|
|
300
300
|
selector: null
|
|
@@ -326,7 +326,7 @@ function createUseWrite(options) {
|
|
|
326
326
|
stateManager,
|
|
327
327
|
eventEmitter,
|
|
328
328
|
pluginExecutor,
|
|
329
|
-
|
|
329
|
+
instanceId,
|
|
330
330
|
fetchFn: async (fetchOpts) => {
|
|
331
331
|
const pathMethods = api(selectedEndpoint.path);
|
|
332
332
|
const method = pathMethods[selectedEndpoint.method];
|
|
@@ -429,7 +429,7 @@ function createUseInfiniteRead(options) {
|
|
|
429
429
|
prevPageRequest,
|
|
430
430
|
...pluginOpts
|
|
431
431
|
} = readOptions;
|
|
432
|
-
const
|
|
432
|
+
const instanceId = useId3();
|
|
433
433
|
const selectorResultRef = useRef3({
|
|
434
434
|
call: null,
|
|
435
435
|
selector: null
|
|
@@ -491,7 +491,7 @@ function createUseInfiniteRead(options) {
|
|
|
491
491
|
stateManager,
|
|
492
492
|
eventEmitter,
|
|
493
493
|
pluginExecutor,
|
|
494
|
-
|
|
494
|
+
instanceId,
|
|
495
495
|
fetchFn: async (opts, signal) => {
|
|
496
496
|
const pathMethods = api(capturedCall.path);
|
|
497
497
|
const method = pathMethods[capturedCall.method];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/react",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React hooks for Spoosh API toolkit",
|
|
6
6
|
"keywords": [
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@spoosh/core": ">=0.
|
|
37
|
+
"@spoosh/core": ">=0.12.0",
|
|
38
38
|
"react": "^18 || ^19"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@testing-library/react": "^16.0.0",
|
|
42
42
|
"jsdom": "^26.0.0",
|
|
43
|
-
"@spoosh/core": "0.
|
|
44
|
-
"@spoosh/test-utils": "0.1.
|
|
43
|
+
"@spoosh/core": "0.12.0",
|
|
44
|
+
"@spoosh/test-utils": "0.1.8"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"dev": "tsup --watch",
|