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

ahooks

Package Overview
Dependencies
Maintainers
5
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ahooks - npm Package Compare versions

Comparing version 3.1.3 to 3.1.4

7

es/useGetState/index.d.ts

@@ -1,4 +0,5 @@

import { Dispatch, SetStateAction } from 'react';
declare type GetState<S> = () => S;
declare function useGetState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>, GetState<S>];
import type { Dispatch, SetStateAction } from 'react';
declare type GetStateAction<S> = () => S;
declare function useGetState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>, GetStateAction<S>];
declare function useGetState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>, GetStateAction<S | undefined>];
export default useGetState;

@@ -16,2 +16,3 @@ import { useRef } from 'react';

var onLongPressRef = useLatest(onLongPress);
var onClickRef = useLatest(onClick);
var timerRef = useRef();

@@ -42,4 +43,4 @@ var isTriggeredRef = useRef(false);

if (shouldTriggerClick && !isTriggeredRef.current && onClick) {
onClick(event);
if (shouldTriggerClick && !isTriggeredRef.current && onClickRef.current) {
onClickRef.current(event);
}

@@ -46,0 +47,0 @@

@@ -15,5 +15,4 @@ var cachePromise = new Map();

return res;
})["catch"](function (err) {
})["catch"](function () {
cachePromise["delete"](cacheKey);
throw err;
});

@@ -20,0 +19,0 @@ };

@@ -1,4 +0,5 @@

import { Dispatch, SetStateAction } from 'react';
declare type GetState<S> = () => S;
declare function useGetState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>, GetState<S>];
import type { Dispatch, SetStateAction } from 'react';
declare type GetStateAction<S> = () => S;
declare function useGetState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>, GetStateAction<S>];
declare function useGetState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>, GetStateAction<S | undefined>];
export default useGetState;

@@ -33,2 +33,3 @@ "use strict";

var onLongPressRef = useLatest_1["default"](onLongPress);
var onClickRef = useLatest_1["default"](onClick);
var timerRef = react_1.useRef();

@@ -59,4 +60,4 @@ var isTriggeredRef = react_1.useRef(false);

if (shouldTriggerClick && !isTriggeredRef.current && onClick) {
onClick(event);
if (shouldTriggerClick && !isTriggeredRef.current && onClickRef.current) {
onClickRef.current(event);
}

@@ -63,0 +64,0 @@

@@ -23,5 +23,4 @@ "use strict";

return res;
})["catch"](function (err) {
})["catch"](function () {
cachePromise["delete"](cacheKey);
throw err;
});

@@ -28,0 +27,0 @@ };

{
"name": "ahooks",
"version": "3.1.3",
"version": "3.1.4",
"description": "react hooks library",

@@ -62,3 +62,3 @@ "keywords": [

"license": "MIT",
"gitHead": "1a67662c37aa8a18d4c612d0516e328e0ff5fad4"
"gitHead": "8b2436a1645d1ba93e327e0b5c0cebeefc692fb9"
}

Sorry, the diff of this file is too big to display

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