Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

create-api-hooks

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-api-hooks - npm Package Compare versions

Comparing version 0.0.41 to 0.0.42

16

dist/index.es.js

@@ -10,2 +10,12 @@ import { useEffect, useState, useCallback, useRef } from 'react';

};
// @ts-ignore
localStorage = localStorage || wx.getStorageSync || {
getItem: function () { },
setItem: function () { }
};
// @ts-ignore
sessionStorage = sessionStorage || wx.getStorageSync || {
getItem: function () { },
setItem: function () { }
};
function createApiHooks(request) {

@@ -17,5 +27,5 @@ var getRequestString = function (params) {

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' ? localStorage.getItem(getRequestString(params)) : cache === 'session' ? sessionStorage.getItem(getRequestString(params)) : cache
? createApiHooksConfig.getCacheFn(getRequestString(params)) || initValue
: initValue;
initValue = (cache === 'local' ? localStorage.getItem(getRequestString(params)) : cache === 'session' ? sessionStorage.getItem(getRequestString(params)) : cache
&& createApiHooksConfig.getCacheFn(getRequestString(params)))
|| initValue;
var initValueRef = useRef(initValue);

@@ -22,0 +32,0 @@ var _g = useState(), error = _g[0], setError = _g[1];

@@ -14,2 +14,12 @@ 'use strict';

};
// @ts-ignore
localStorage = localStorage || wx.getStorageSync || {
getItem: function () { },
setItem: function () { }
};
// @ts-ignore
sessionStorage = sessionStorage || wx.getStorageSync || {
getItem: function () { },
setItem: function () { }
};
function createApiHooks(request) {

@@ -21,5 +31,5 @@ var getRequestString = function (params) {

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' ? localStorage.getItem(getRequestString(params)) : cache === 'session' ? sessionStorage.getItem(getRequestString(params)) : cache
? createApiHooksConfig.getCacheFn(getRequestString(params)) || initValue
: initValue;
initValue = (cache === 'local' ? localStorage.getItem(getRequestString(params)) : cache === 'session' ? sessionStorage.getItem(getRequestString(params)) : cache
&& createApiHooksConfig.getCacheFn(getRequestString(params)))
|| initValue;
var initValueRef = react.useRef(initValue);

@@ -26,0 +36,0 @@ var _g = react.useState(), error = _g[0], setError = _g[1];

2

package.json
{
"name": "create-api-hooks",
"version": "0.0.41",
"version": "0.0.42",
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc