floppy-disk 2.0.1-beta.2 → 2.0.2-beta.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
CHANGED
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
useInfiniteQuery,
|
|
18
18
|
useMutation,
|
|
19
19
|
} from '@tanstack/react-query'; // 41 kB (gzipped: 11 kB)
|
|
20
|
-
import { createQuery, createMutation } from 'floppy-disk'; // 8.
|
|
20
|
+
import { createQuery, createMutation } from 'floppy-disk'; // 8.2 kB (gzipped: 2.8 kB) 🎉
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
- Using Zustand & React-Query: https://demo-zustand-react-query.vercel.app/
|
|
24
24
|
👉 Total: **309.21 kB**
|
|
25
25
|
- Using Floppy Disk: https://demo-floppy-disk.vercel.app/
|
|
26
|
-
👉 Total: **
|
|
26
|
+
👉 Total: **270.86 kB** 🎉
|
|
27
27
|
|
|
28
28
|
## Key Features
|
|
29
29
|
|
|
@@ -273,7 +273,7 @@ export const createQuery = (queryFn, options = {}) => {
|
|
|
273
273
|
useQuery.setInitialResponse = ({ key, response }) => {
|
|
274
274
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
275
275
|
useState(() => {
|
|
276
|
-
if (response === undefined)
|
|
276
|
+
if (response === undefined || useQuery.get(key).data)
|
|
277
277
|
return;
|
|
278
278
|
const newPageParam = getNextPageParam(response, 1);
|
|
279
279
|
useQuery.set(key, {
|
|
@@ -273,7 +273,7 @@ export const createQuery = (queryFn, options = {}) => {
|
|
|
273
273
|
useQuery.setInitialResponse = ({ key, response }) => {
|
|
274
274
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
275
275
|
useState(() => {
|
|
276
|
-
if (response === undefined)
|
|
276
|
+
if (response === undefined || useQuery.get(key).data)
|
|
277
277
|
return;
|
|
278
278
|
const newPageParam = getNextPageParam(response, 1);
|
|
279
279
|
useQuery.set(key, {
|
|
@@ -276,7 +276,7 @@ const createQuery = (queryFn, options = {}) => {
|
|
|
276
276
|
useQuery.setInitialResponse = ({ key, response }) => {
|
|
277
277
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
278
278
|
(0, hooks_1.useState)(() => {
|
|
279
|
-
if (response === undefined)
|
|
279
|
+
if (response === undefined || useQuery.get(key).data)
|
|
280
280
|
return;
|
|
281
281
|
const newPageParam = getNextPageParam(response, 1);
|
|
282
282
|
useQuery.set(key, {
|
|
@@ -276,7 +276,7 @@ const createQuery = (queryFn, options = {}) => {
|
|
|
276
276
|
useQuery.setInitialResponse = ({ key, response }) => {
|
|
277
277
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
278
278
|
(0, react_1.useState)(() => {
|
|
279
|
-
if (response === undefined)
|
|
279
|
+
if (response === undefined || useQuery.get(key).data)
|
|
280
280
|
return;
|
|
281
281
|
const newPageParam = getNextPageParam(response, 1);
|
|
282
282
|
useQuery.set(key, {
|