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.18 to 0.0.19

7

dist/index.es.js
import { useEffect, useState, useCallback, useRef } from 'react';
var cacheObj = {};
var deepCacheApis = [];
var createApiHooksConfig = {

@@ -31,6 +32,10 @@ setCacheFn: function (name, value) { return (cacheObj[name] = value); },

var isOutRequest = isOutRequestRef.current;
var requestString = getRequestString(params);
if ((JSON.stringify(preParams.current) === JSON.stringify(params) &&
!isOutRequest) ||
(deepCache && getCacheFn(getRequestString(params))))
(deepCache &&
getCacheFn(requestString) &&
deepCacheApis.includes(requestString)))
return Promise.resolve(data);
deepCacheApis.push(requestString);
isOutRequestRef.current = false;

@@ -37,0 +42,0 @@ preParams.current = params && JSON.parse(JSON.stringify(params));

@@ -8,2 +8,3 @@ 'use strict';

var cacheObj = {};
var deepCacheApis = [];
var createApiHooksConfig = {

@@ -36,6 +37,10 @@ setCacheFn: function (name, value) { return (cacheObj[name] = value); },

var isOutRequest = isOutRequestRef.current;
var requestString = getRequestString(params);
if ((JSON.stringify(preParams.current) === JSON.stringify(params) &&
!isOutRequest) ||
(deepCache && getCacheFn(getRequestString(params))))
(deepCache &&
getCacheFn(requestString) &&
deepCacheApis.includes(requestString)))
return Promise.resolve(data);
deepCacheApis.push(requestString);
isOutRequestRef.current = false;

@@ -42,0 +47,0 @@ preParams.current = params && JSON.parse(JSON.stringify(params));

2

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