create-api-hooks
Advanced tools
Comparing version 0.0.49 to 0.0.50
@@ -41,5 +41,7 @@ import { useEffect, useState, useCallback, useRef } from 'react'; | ||
var _b = _a === void 0 ? {} : _a, _c = _b.cache, cache = _c === void 0 ? true : _c, _d = _b.initValue, initValue = _d === void 0 ? {} : _d, params = _b.params, _e = _b.needInit, needInit = _e === void 0 ? true : _e, _f = _b.deepCache, deepCache = _f === void 0 ? false : _f, debounceInterval = _b.debounceInterval; | ||
initValue = (cache === 'local' ? localStore.getItem(getRequestString(params)) : cache === 'session' ? sessionStore.getItem(getRequestString(params)) : cache | ||
var cacheValue = cache === 'local' ? localStore.getItem(getRequestString(params)) : cache === 'session' ? sessionStore.getItem(getRequestString(params)) : null; | ||
initValue = (cacheValue !== null ? cacheValue : cache | ||
&& createApiHooksConfig.getCacheFn(getRequestString(params))) | ||
|| initValue; | ||
needInit = deepCache && typeof cache === 'string' && cacheValue !== null ? false : needInit; | ||
var initValueRef = useRef(initValue); | ||
@@ -46,0 +48,0 @@ var _g = useState(), error = _g[0], setError = _g[1]; |
@@ -45,5 +45,7 @@ 'use strict'; | ||
var _b = _a === void 0 ? {} : _a, _c = _b.cache, cache = _c === void 0 ? true : _c, _d = _b.initValue, initValue = _d === void 0 ? {} : _d, params = _b.params, _e = _b.needInit, needInit = _e === void 0 ? true : _e, _f = _b.deepCache, deepCache = _f === void 0 ? false : _f, debounceInterval = _b.debounceInterval; | ||
initValue = (cache === 'local' ? localStore.getItem(getRequestString(params)) : cache === 'session' ? sessionStore.getItem(getRequestString(params)) : cache | ||
var cacheValue = cache === 'local' ? localStore.getItem(getRequestString(params)) : cache === 'session' ? sessionStore.getItem(getRequestString(params)) : null; | ||
initValue = (cacheValue !== null ? cacheValue : cache | ||
&& createApiHooksConfig.getCacheFn(getRequestString(params))) | ||
|| initValue; | ||
needInit = deepCache && typeof cache === 'string' && cacheValue !== null ? false : needInit; | ||
var initValueRef = react.useRef(initValue); | ||
@@ -50,0 +52,0 @@ var _g = react.useState(), error = _g[0], setError = _g[1]; |
{ | ||
"name": "create-api-hooks", | ||
"version": "0.0.49", | ||
"version": "0.0.50", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "mushan0x0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
46944
384