resourcerer 1.0.5 → 1.0.6
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/lib/resourcerer.js +4 -3
- package/package.json +1 -1
package/lib/resourcerer.js
CHANGED
|
@@ -108,14 +108,15 @@ export const useResources = (getResources, props) => {
|
|
|
108
108
|
getResourcesToUpdate = (rsrcs) => rsrcs.filter(hasAllDependencies.bind(null, props))
|
|
109
109
|
.filter(not(shouldBypassFetch.bind(null, props)))
|
|
110
110
|
.filter(([name, config]) => {
|
|
111
|
-
var prevConfig =
|
|
112
|
-
|
|
111
|
+
var prevConfig = prevPropsRef.current &&
|
|
112
|
+
findConfig([name, config], getResources, prevPropsRef.current),
|
|
113
|
+
previousCacheKey = prevConfig && getCacheKey(prevConfig);
|
|
113
114
|
|
|
114
115
|
return (!previousCacheKey || previousCacheKey !== getCacheKey(config) ||
|
|
115
116
|
!hasAllDependencies(prevPropsRef.current, [, config]) || config.refetch ||
|
|
116
117
|
// make sure if we were lazy and are no longer lazy (from the same component) that we
|
|
117
118
|
// get included in the list to get updated
|
|
118
|
-
(prevConfig
|
|
119
|
+
(prevConfig?.lazy && !config.lazy));
|
|
119
120
|
});
|
|
120
121
|
|
|
121
122
|
/**
|