floppy-disk 2.7.2-beta.1 → 2.7.2-beta.2

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.
@@ -192,6 +192,10 @@ export const createQuery = (queryFn, options = {}) => {
192
192
  const stateBeforeCallQuery = get();
193
193
  queryFn(key, { ...state, pageParam })
194
194
  .then((response) => {
195
+ if (preventReplaceResponse.get(keyHash)) {
196
+ set({ isWaitingNextPage: false });
197
+ return resolve(get());
198
+ }
195
199
  const newPageParam = getNextPageParam(response, pageParams.length, stateBeforeCallQuery);
196
200
  set({
197
201
  isWaitingNextPage: false,
@@ -191,6 +191,10 @@ export const createQuery = (queryFn, options = {}) => {
191
191
  const stateBeforeCallQuery = get();
192
192
  queryFn(key, { ...state, pageParam })
193
193
  .then((response) => {
194
+ if (preventReplaceResponse.get(keyHash)) {
195
+ set({ isWaitingNextPage: false });
196
+ return resolve(get());
197
+ }
194
198
  const newPageParam = getNextPageParam(response, pageParams.length, stateBeforeCallQuery);
195
199
  set({
196
200
  isWaitingNextPage: false,
@@ -195,6 +195,10 @@ const createQuery = (queryFn, options = {}) => {
195
195
  const stateBeforeCallQuery = get();
196
196
  queryFn(key, { ...state, pageParam })
197
197
  .then((response) => {
198
+ if (preventReplaceResponse.get(keyHash)) {
199
+ set({ isWaitingNextPage: false });
200
+ return resolve(get());
201
+ }
198
202
  const newPageParam = getNextPageParam(response, pageParams.length, stateBeforeCallQuery);
199
203
  set({
200
204
  isWaitingNextPage: false,
@@ -194,6 +194,10 @@ const createQuery = (queryFn, options = {}) => {
194
194
  const stateBeforeCallQuery = get();
195
195
  queryFn(key, { ...state, pageParam })
196
196
  .then((response) => {
197
+ if (preventReplaceResponse.get(keyHash)) {
198
+ set({ isWaitingNextPage: false });
199
+ return resolve(get());
200
+ }
197
201
  const newPageParam = getNextPageParam(response, pageParams.length, stateBeforeCallQuery);
198
202
  set({
199
203
  isWaitingNextPage: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "floppy-disk",
3
- "version": "2.7.2-beta.1",
3
+ "version": "2.7.2-beta.2",
4
4
  "description": "FloppyDisk - lightweight, simple, and powerful state management library",
5
5
  "keywords": [
6
6
  "state",