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.12 to 0.0.13

13

dist/index.es.js

@@ -8,3 +8,4 @@ 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;
initValue = cache && needInit ? cacheObj[requestName] || initValue : initValue;
initValue =
cache && needInit ? cacheObj[requestName] || initValue : initValue;
var _f = useState(), error = _f[0], setError = _f[1];

@@ -72,8 +73,6 @@ var _g = useState(initValue), data = _g[0], setData = _g[1];

var result = Hooks;
result.request = function (params) {
return request(params).then(function (_a) {
var data = _a.data;
return Promise.resolve(data);
});
};
result.request = useCallback(function (params) { return request(params).then(function (_a) {
var data = _a.data;
return Promise.resolve(data);
}); }, [request]);
return result;

@@ -80,0 +79,0 @@ }

@@ -12,3 +12,4 @@ '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;
initValue = cache && needInit ? cacheObj[requestName] || initValue : initValue;
initValue =
cache && needInit ? cacheObj[requestName] || initValue : initValue;
var _f = react.useState(), error = _f[0], setError = _f[1];

@@ -76,8 +77,6 @@ var _g = react.useState(initValue), data = _g[0], setData = _g[1];

var result = Hooks;
result.request = function (params) {
return request(params).then(function (_a) {
var data = _a.data;
return Promise.resolve(data);
});
};
result.request = react.useCallback(function (params) { return request(params).then(function (_a) {
var data = _a.data;
return Promise.resolve(data);
}); }, [request]);
return result;

@@ -84,0 +83,0 @@ }

{
"name": "create-api-hooks",
"version": "0.0.12",
"version": "0.0.13",
"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