@magnetarjs/core
Advanced tools
Comparing version 0.3.5 to 0.3.7
@@ -504,8 +504,9 @@ 'use strict'; | ||
if (actionName === 'fetch') { | ||
const optimisticFetch = !payload || | ||
!Object.hasOwnProperty.call(payload || {}, 'force') || | ||
(payload === null || payload === void 0 ? void 0 : payload.force) === false; | ||
const force = (payload === null || payload === void 0 ? void 0 : payload.force) === true; | ||
const optimisticFetch = !force; | ||
if (optimisticFetch) { | ||
// the local store successfully returned a fetch response based on already fetched data | ||
if (storeName === globalConfig.localStoreName && isFetchResponse(resultFromPlugin)) { | ||
if (storeName === globalConfig.localStoreName && | ||
isFetchResponse(resultFromPlugin) && | ||
resultFromPlugin.docs.length) { | ||
stopExecutionAfterAction(true); | ||
@@ -512,0 +513,0 @@ } |
@@ -500,8 +500,9 @@ import { merge, mergeAndConcat } from 'merge-anything'; | ||
if (actionName === 'fetch') { | ||
const optimisticFetch = !payload || | ||
!Object.hasOwnProperty.call(payload || {}, 'force') || | ||
(payload === null || payload === void 0 ? void 0 : payload.force) === false; | ||
const force = (payload === null || payload === void 0 ? void 0 : payload.force) === true; | ||
const optimisticFetch = !force; | ||
if (optimisticFetch) { | ||
// the local store successfully returned a fetch response based on already fetched data | ||
if (storeName === globalConfig.localStoreName && isFetchResponse(resultFromPlugin)) { | ||
if (storeName === globalConfig.localStoreName && | ||
isFetchResponse(resultFromPlugin) && | ||
resultFromPlugin.docs.length) { | ||
stopExecutionAfterAction(true); | ||
@@ -508,0 +509,0 @@ } |
{ | ||
"name": "@magnetarjs/core", | ||
"version": "0.3.5", | ||
"version": "0.3.7", | ||
"sideEffects": false, | ||
@@ -26,3 +26,3 @@ "description": "Magnetar core library.", | ||
"devDependencies": { | ||
"@magnetarjs/test-utils": "^0.1.16" | ||
"@magnetarjs/test-utils": "^0.1.18" | ||
}, | ||
@@ -70,3 +70,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "a07b7b0bd09341394ac94c9627650d813052d15a" | ||
"gitHead": "641b0f9aadf1a8ac1394eece5b126ee6dbd29c87" | ||
} |
@@ -227,9 +227,11 @@ /* eslint-disable no-inner-declarations */ | ||
if (actionName === 'fetch') { | ||
const optimisticFetch = | ||
!payload || | ||
!Object.hasOwnProperty.call(payload || {}, 'force') || | ||
payload?.force === false | ||
const force = payload?.force === true | ||
const optimisticFetch = !force | ||
if (optimisticFetch) { | ||
// the local store successfully returned a fetch response based on already fetched data | ||
if (storeName === globalConfig.localStoreName && isFetchResponse(resultFromPlugin)) { | ||
if ( | ||
storeName === globalConfig.localStoreName && | ||
isFetchResponse(resultFromPlugin) && | ||
resultFromPlugin.docs.length | ||
) { | ||
stopExecutionAfterAction(true) | ||
@@ -236,0 +238,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
302704
6978