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.9 to 3.1.10

3

es/index.d.ts

@@ -72,2 +72,3 @@ import useAntdTable from './useAntdTable';

import useWhyDidYouUpdate from './useWhyDidYouUpdate';
export { useRequest, useControllableValue, useDynamicList, useVirtualList, useResponsive, useEventEmitter, useLocalStorageState, useSessionStorageState, useSize, configResponsive, useUpdateEffect, useUpdateLayoutEffect, useBoolean, useToggle, useDocumentVisibility, useSelections, useThrottle, useThrottleFn, useThrottleEffect, useDebounce, useDebounceFn, useDebounceEffect, usePrevious, useMouse, useScroll, useClickAway, useFullscreen, useInViewport, useKeyPress, useEventListener, useHover, useUnmount, useSet, useMemoizedFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useCookieState, useSetState, useInterval, useWhyDidYouUpdate, useTitle, useNetwork, useTimeout, useReactive, useFavicon, useCountDown, useWebSocket, useLockFn, useUnmountedRef, useExternal, useSafeState, useLatest, useIsomorphicLayoutEffect, useDeepCompareEffect, useAsyncEffect, useLongPress, useRafState, useTrackedEffect, usePagination, useAntdTable, useFusionTable, useInfiniteScroll, useGetState, clearCache, useFocusWithin, };
import { createUpdateEffect } from './createUpdateEffect';
export { useRequest, useControllableValue, useDynamicList, useVirtualList, useResponsive, useEventEmitter, useLocalStorageState, useSessionStorageState, useSize, configResponsive, useUpdateEffect, useUpdateLayoutEffect, useBoolean, useToggle, useDocumentVisibility, useSelections, useThrottle, useThrottleFn, useThrottleEffect, useDebounce, useDebounceFn, useDebounceEffect, usePrevious, useMouse, useScroll, useClickAway, useFullscreen, useInViewport, useKeyPress, useEventListener, useHover, useUnmount, useSet, useMemoizedFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useCookieState, useSetState, useInterval, useWhyDidYouUpdate, useTitle, useNetwork, useTimeout, useReactive, useFavicon, useCountDown, useWebSocket, useLockFn, useUnmountedRef, useExternal, useSafeState, useLatest, useIsomorphicLayoutEffect, useDeepCompareEffect, useAsyncEffect, useLongPress, useRafState, useTrackedEffect, usePagination, useAntdTable, useFusionTable, useInfiniteScroll, useGetState, clearCache, useFocusWithin, createUpdateEffect, };

@@ -72,2 +72,3 @@ import useAntdTable from './useAntdTable';

import useWhyDidYouUpdate from './useWhyDidYouUpdate';
export { useRequest, useControllableValue, useDynamicList, useVirtualList, useResponsive, useEventEmitter, useLocalStorageState, useSessionStorageState, useSize, configResponsive, useUpdateEffect, useUpdateLayoutEffect, useBoolean, useToggle, useDocumentVisibility, useSelections, useThrottle, useThrottleFn, useThrottleEffect, useDebounce, useDebounceFn, useDebounceEffect, usePrevious, useMouse, useScroll, useClickAway, useFullscreen, useInViewport, useKeyPress, useEventListener, useHover, useUnmount, useSet, useMemoizedFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useCookieState, useSetState, useInterval, useWhyDidYouUpdate, useTitle, useNetwork, useTimeout, useReactive, useFavicon, useCountDown, useWebSocket, useLockFn, useUnmountedRef, useExternal, useSafeState, useLatest, useIsomorphicLayoutEffect, useDeepCompareEffect, useAsyncEffect, useLongPress, useRafState, useTrackedEffect, usePagination, useAntdTable, useFusionTable, useInfiniteScroll, useGetState, clearCache, useFocusWithin };
import { createUpdateEffect } from './createUpdateEffect';
export { useRequest, useControllableValue, useDynamicList, useVirtualList, useResponsive, useEventEmitter, useLocalStorageState, useSessionStorageState, useSize, configResponsive, useUpdateEffect, useUpdateLayoutEffect, useBoolean, useToggle, useDocumentVisibility, useSelections, useThrottle, useThrottleFn, useThrottleEffect, useDebounce, useDebounceFn, useDebounceEffect, usePrevious, useMouse, useScroll, useClickAway, useFullscreen, useInViewport, useKeyPress, useEventListener, useHover, useUnmount, useSet, useMemoizedFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useCookieState, useSetState, useInterval, useWhyDidYouUpdate, useTitle, useNetwork, useTimeout, useReactive, useFavicon, useCountDown, useWebSocket, useLockFn, useUnmountedRef, useExternal, useSafeState, useLatest, useIsomorphicLayoutEffect, useDeepCompareEffect, useAsyncEffect, useLongPress, useRafState, useTrackedEffect, usePagination, useAntdTable, useFusionTable, useInfiniteScroll, useGetState, clearCache, useFocusWithin, createUpdateEffect };

@@ -6,3 +6,3 @@ import Cookies from 'js-cookie';

}
declare function useCookieState(cookieKey: string, options?: Options): readonly [string | undefined, (newValue: string | ((prevState: State) => State) | undefined, newOptions?: Cookies.CookieAttributes) => void];
declare function useCookieState(cookieKey: string, options?: Options): readonly [string | undefined, (this: unknown, newValue: string | ((prevState: State) => State) | undefined, newOptions?: Cookies.CookieAttributes | undefined) => void];
export default useCookieState;

@@ -13,7 +13,7 @@ export interface Options {

declare function useCounter(initialValue?: number, options?: Options): readonly [number, {
readonly inc: (delta?: number) => void;
readonly dec: (delta?: number) => void;
readonly set: (value: ValueParam) => void;
readonly reset: () => void;
readonly inc: (this: unknown, delta?: number | undefined) => void;
readonly dec: (this: unknown, delta?: number | undefined) => void;
readonly set: (this: unknown, value: ValueParam) => void;
readonly reset: (this: unknown) => void;
}];
export default useCounter;

@@ -7,7 +7,7 @@ import type { BasicTarget } from '../utils/domTarget';

declare const useFullscreen: (target: BasicTarget, options?: Options | undefined) => readonly [boolean, {
readonly enterFullscreen: () => void;
readonly exitFullscreen: () => void;
readonly toggleFullscreen: () => void;
readonly enterFullscreen: (this: unknown) => void;
readonly exitFullscreen: (this: unknown) => void;
readonly toggleFullscreen: (this: unknown) => void;
readonly isEnabled: true;
}];
export default useFullscreen;

@@ -5,7 +5,7 @@ export default function useHistoryTravel<T>(initialValue?: T): {

forwardLength: number;
setValue: (val: T) => void;
go: (step: number) => void;
back: () => void;
forward: () => void;
reset: (...params: any[]) => void;
setValue: (this: unknown, val: T) => void;
go: (this: unknown, step: number) => void;
back: (this: unknown) => void;
forward: (this: unknown) => void;
reset: (this: unknown, ...args: any[]) => void;
};

@@ -8,6 +8,6 @@ /// <reference types="react" />

noMore: boolean;
loadMore: () => void;
loadMoreAsync: () => Promise<TData> | undefined;
reload: () => void;
reloadAsync: () => Promise<TData>;
loadMore: (this: unknown) => void;
loadMoreAsync: (this: unknown) => Promise<TData> | undefined;
reload: (this: unknown) => void;
reloadAsync: (this: unknown) => Promise<TData>;
mutate: import("react").Dispatch<import("react").SetStateAction<TData | undefined>>;

@@ -14,0 +14,0 @@ cancel: () => void;

declare function useMap<K, T>(initialValue?: Iterable<readonly [K, T]>): readonly [Map<K, T>, {
readonly set: (key: K, entry: T) => void;
readonly setAll: (newMap: Iterable<readonly [K, T]>) => void;
readonly remove: (key: K) => void;
readonly reset: () => void;
readonly get: (key: K) => T | undefined;
readonly set: (this: unknown, key: K, entry: T) => void;
readonly setAll: (this: unknown, newMap: Iterable<readonly [K, T]>) => void;
readonly remove: (this: unknown, key: K) => void;
readonly reset: (this: unknown) => void;
readonly get: (this: unknown, key: K) => T | undefined;
}];
export default useMap;

@@ -1,3 +0,4 @@

declare type noop = (...args: any[]) => any;
declare function useMemoizedFn<T extends noop>(fn: T): T;
declare type noop = (this: any, ...args: any[]) => any;
declare type PickFunction<T extends noop> = (this: ThisParameterType<T>, ...args: Parameters<T>) => ReturnType<T>;
declare function useMemoizedFn<T extends noop>(fn: T): PickFunction<T>;
export default useMemoizedFn;

@@ -24,5 +24,4 @@ import { useMemo, useRef } from 'react';

args[_i] = arguments[_i];
} // eslint-disable-next-line @typescript-eslint/no-invalid-this
}
return fnRef.current.apply(this, args);

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

@@ -9,8 +9,8 @@ /// <reference types="react" />

readonly isSelected: (item: T) => boolean;
readonly select: (item: T) => void;
readonly unSelect: (item: T) => void;
readonly toggle: (item: T) => void;
readonly selectAll: () => void;
readonly unSelectAll: () => void;
readonly toggleAll: () => void;
readonly select: (this: unknown, item: T) => void;
readonly unSelect: (this: unknown, item: T) => void;
readonly toggle: (this: unknown, item: T) => void;
readonly selectAll: (this: unknown) => void;
readonly unSelectAll: (this: unknown) => void;
readonly toggleAll: (this: unknown) => void;
};
declare function useSet<K>(initialValue?: Iterable<K>): readonly [Set<K>, {
readonly add: (key: K) => void;
readonly remove: (key: K) => void;
readonly reset: () => void;
readonly add: (this: unknown, key: K) => void;
readonly remove: (this: unknown, key: K) => void;
readonly reset: (this: unknown) => void;
}];
export default useSet;

@@ -11,3 +11,3 @@ import type { BasicTarget } from '../utils/domTarget';

data: T;
}[], (index: number) => void];
}[], (this: unknown, index: number) => void];
export default useVirtualList;

@@ -72,2 +72,3 @@ import useAntdTable from './useAntdTable';

import useWhyDidYouUpdate from './useWhyDidYouUpdate';
export { useRequest, useControllableValue, useDynamicList, useVirtualList, useResponsive, useEventEmitter, useLocalStorageState, useSessionStorageState, useSize, configResponsive, useUpdateEffect, useUpdateLayoutEffect, useBoolean, useToggle, useDocumentVisibility, useSelections, useThrottle, useThrottleFn, useThrottleEffect, useDebounce, useDebounceFn, useDebounceEffect, usePrevious, useMouse, useScroll, useClickAway, useFullscreen, useInViewport, useKeyPress, useEventListener, useHover, useUnmount, useSet, useMemoizedFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useCookieState, useSetState, useInterval, useWhyDidYouUpdate, useTitle, useNetwork, useTimeout, useReactive, useFavicon, useCountDown, useWebSocket, useLockFn, useUnmountedRef, useExternal, useSafeState, useLatest, useIsomorphicLayoutEffect, useDeepCompareEffect, useAsyncEffect, useLongPress, useRafState, useTrackedEffect, usePagination, useAntdTable, useFusionTable, useInfiniteScroll, useGetState, clearCache, useFocusWithin, };
import { createUpdateEffect } from './createUpdateEffect';
export { useRequest, useControllableValue, useDynamicList, useVirtualList, useResponsive, useEventEmitter, useLocalStorageState, useSessionStorageState, useSize, configResponsive, useUpdateEffect, useUpdateLayoutEffect, useBoolean, useToggle, useDocumentVisibility, useSelections, useThrottle, useThrottleFn, useThrottleEffect, useDebounce, useDebounceFn, useDebounceEffect, usePrevious, useMouse, useScroll, useClickAway, useFullscreen, useInViewport, useKeyPress, useEventListener, useHover, useUnmount, useSet, useMemoizedFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useCookieState, useSetState, useInterval, useWhyDidYouUpdate, useTitle, useNetwork, useTimeout, useReactive, useFavicon, useCountDown, useWebSocket, useLockFn, useUnmountedRef, useExternal, useSafeState, useLatest, useIsomorphicLayoutEffect, useDeepCompareEffect, useAsyncEffect, useLongPress, useRafState, useTrackedEffect, usePagination, useAntdTable, useFusionTable, useInfiniteScroll, useGetState, clearCache, useFocusWithin, createUpdateEffect, };

@@ -46,3 +46,3 @@ "use strict";

});
exports.useFocusWithin = exports.clearCache = exports.useGetState = exports.useInfiniteScroll = exports.useFusionTable = exports.useAntdTable = exports.usePagination = exports.useTrackedEffect = exports.useRafState = exports.useLongPress = exports.useAsyncEffect = exports.useDeepCompareEffect = exports.useIsomorphicLayoutEffect = exports.useLatest = exports.useSafeState = exports.useExternal = exports.useUnmountedRef = exports.useLockFn = exports.useWebSocket = exports.useCountDown = exports.useFavicon = exports.useReactive = exports.useTimeout = exports.useNetwork = exports.useTitle = exports.useWhyDidYouUpdate = exports.useInterval = exports.useSetState = exports.useCookieState = exports.useHistoryTravel = exports.useEventTarget = exports.useTextSelection = exports.useUpdate = exports.useCounter = exports.useMount = exports.useDrop = exports.useDrag = exports.useCreation = exports.useMap = exports.useMemoizedFn = exports.useSet = exports.useUnmount = exports.useHover = exports.useEventListener = exports.useKeyPress = exports.useInViewport = exports.useFullscreen = exports.useClickAway = exports.useScroll = exports.useMouse = exports.usePrevious = exports.useDebounceEffect = exports.useDebounceFn = exports.useDebounce = exports.useThrottleEffect = exports.useThrottleFn = exports.useThrottle = exports.useSelections = exports.useDocumentVisibility = exports.useToggle = exports.useBoolean = exports.useUpdateLayoutEffect = exports.useUpdateEffect = exports.configResponsive = exports.useSize = exports.useSessionStorageState = exports.useLocalStorageState = exports.useEventEmitter = exports.useResponsive = exports.useVirtualList = exports.useDynamicList = exports.useControllableValue = exports.useRequest = void 0;
exports.createUpdateEffect = exports.useFocusWithin = exports.clearCache = exports.useGetState = exports.useInfiniteScroll = exports.useFusionTable = exports.useAntdTable = exports.usePagination = exports.useTrackedEffect = exports.useRafState = exports.useLongPress = exports.useAsyncEffect = exports.useDeepCompareEffect = exports.useIsomorphicLayoutEffect = exports.useLatest = exports.useSafeState = exports.useExternal = exports.useUnmountedRef = exports.useLockFn = exports.useWebSocket = exports.useCountDown = exports.useFavicon = exports.useReactive = exports.useTimeout = exports.useNetwork = exports.useTitle = exports.useWhyDidYouUpdate = exports.useInterval = exports.useSetState = exports.useCookieState = exports.useHistoryTravel = exports.useEventTarget = exports.useTextSelection = exports.useUpdate = exports.useCounter = exports.useMount = exports.useDrop = exports.useDrag = exports.useCreation = exports.useMap = exports.useMemoizedFn = exports.useSet = exports.useUnmount = exports.useHover = exports.useEventListener = exports.useKeyPress = exports.useInViewport = exports.useFullscreen = exports.useClickAway = exports.useScroll = exports.useMouse = exports.usePrevious = exports.useDebounceEffect = exports.useDebounceFn = exports.useDebounce = exports.useThrottleEffect = exports.useThrottleFn = exports.useThrottle = exports.useSelections = exports.useDocumentVisibility = exports.useToggle = exports.useBoolean = exports.useUpdateLayoutEffect = exports.useUpdateEffect = exports.configResponsive = exports.useSize = exports.useSessionStorageState = exports.useLocalStorageState = exports.useEventEmitter = exports.useResponsive = exports.useVirtualList = exports.useDynamicList = exports.useControllableValue = exports.useRequest = void 0;

@@ -348,2 +348,11 @@ var useAntdTable_1 = __importDefault(require("./useAntdTable"));

exports.useWhyDidYouUpdate = useWhyDidYouUpdate_1["default"];
exports.useWhyDidYouUpdate = useWhyDidYouUpdate_1["default"];
var createUpdateEffect_1 = require("./createUpdateEffect");
Object.defineProperty(exports, "createUpdateEffect", {
enumerable: true,
get: function get() {
return createUpdateEffect_1.createUpdateEffect;
}
});

@@ -6,3 +6,3 @@ import Cookies from 'js-cookie';

}
declare function useCookieState(cookieKey: string, options?: Options): readonly [string | undefined, (newValue: string | ((prevState: State) => State) | undefined, newOptions?: Cookies.CookieAttributes) => void];
declare function useCookieState(cookieKey: string, options?: Options): readonly [string | undefined, (this: unknown, newValue: string | ((prevState: State) => State) | undefined, newOptions?: Cookies.CookieAttributes | undefined) => void];
export default useCookieState;

@@ -13,7 +13,7 @@ export interface Options {

declare function useCounter(initialValue?: number, options?: Options): readonly [number, {
readonly inc: (delta?: number) => void;
readonly dec: (delta?: number) => void;
readonly set: (value: ValueParam) => void;
readonly reset: () => void;
readonly inc: (this: unknown, delta?: number | undefined) => void;
readonly dec: (this: unknown, delta?: number | undefined) => void;
readonly set: (this: unknown, value: ValueParam) => void;
readonly reset: (this: unknown) => void;
}];
export default useCounter;

@@ -7,7 +7,7 @@ import type { BasicTarget } from '../utils/domTarget';

declare const useFullscreen: (target: BasicTarget, options?: Options | undefined) => readonly [boolean, {
readonly enterFullscreen: () => void;
readonly exitFullscreen: () => void;
readonly toggleFullscreen: () => void;
readonly enterFullscreen: (this: unknown) => void;
readonly exitFullscreen: (this: unknown) => void;
readonly toggleFullscreen: (this: unknown) => void;
readonly isEnabled: true;
}];
export default useFullscreen;

@@ -5,7 +5,7 @@ export default function useHistoryTravel<T>(initialValue?: T): {

forwardLength: number;
setValue: (val: T) => void;
go: (step: number) => void;
back: () => void;
forward: () => void;
reset: (...params: any[]) => void;
setValue: (this: unknown, val: T) => void;
go: (this: unknown, step: number) => void;
back: (this: unknown) => void;
forward: (this: unknown) => void;
reset: (this: unknown, ...args: any[]) => void;
};

@@ -8,6 +8,6 @@ /// <reference types="react" />

noMore: boolean;
loadMore: () => void;
loadMoreAsync: () => Promise<TData> | undefined;
reload: () => void;
reloadAsync: () => Promise<TData>;
loadMore: (this: unknown) => void;
loadMoreAsync: (this: unknown) => Promise<TData> | undefined;
reload: (this: unknown) => void;
reloadAsync: (this: unknown) => Promise<TData>;
mutate: import("react").Dispatch<import("react").SetStateAction<TData | undefined>>;

@@ -14,0 +14,0 @@ cancel: () => void;

declare function useMap<K, T>(initialValue?: Iterable<readonly [K, T]>): readonly [Map<K, T>, {
readonly set: (key: K, entry: T) => void;
readonly setAll: (newMap: Iterable<readonly [K, T]>) => void;
readonly remove: (key: K) => void;
readonly reset: () => void;
readonly get: (key: K) => T | undefined;
readonly set: (this: unknown, key: K, entry: T) => void;
readonly setAll: (this: unknown, newMap: Iterable<readonly [K, T]>) => void;
readonly remove: (this: unknown, key: K) => void;
readonly reset: (this: unknown) => void;
readonly get: (this: unknown, key: K) => T | undefined;
}];
export default useMap;

@@ -1,3 +0,4 @@

declare type noop = (...args: any[]) => any;
declare function useMemoizedFn<T extends noop>(fn: T): T;
declare type noop = (this: any, ...args: any[]) => any;
declare type PickFunction<T extends noop> = (this: ThisParameterType<T>, ...args: Parameters<T>) => ReturnType<T>;
declare function useMemoizedFn<T extends noop>(fn: T): PickFunction<T>;
export default useMemoizedFn;

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

args[_i] = arguments[_i];
} // eslint-disable-next-line @typescript-eslint/no-invalid-this
}
return fnRef.current.apply(this, args);

@@ -35,0 +34,0 @@ };

@@ -9,8 +9,8 @@ /// <reference types="react" />

readonly isSelected: (item: T) => boolean;
readonly select: (item: T) => void;
readonly unSelect: (item: T) => void;
readonly toggle: (item: T) => void;
readonly selectAll: () => void;
readonly unSelectAll: () => void;
readonly toggleAll: () => void;
readonly select: (this: unknown, item: T) => void;
readonly unSelect: (this: unknown, item: T) => void;
readonly toggle: (this: unknown, item: T) => void;
readonly selectAll: (this: unknown) => void;
readonly unSelectAll: (this: unknown) => void;
readonly toggleAll: (this: unknown) => void;
};
declare function useSet<K>(initialValue?: Iterable<K>): readonly [Set<K>, {
readonly add: (key: K) => void;
readonly remove: (key: K) => void;
readonly reset: () => void;
readonly add: (this: unknown, key: K) => void;
readonly remove: (this: unknown, key: K) => void;
readonly reset: (this: unknown) => void;
}];
export default useSet;

@@ -11,3 +11,3 @@ import type { BasicTarget } from '../utils/domTarget';

data: T;
}[], (index: number) => void];
}[], (this: unknown, index: number) => void];
export default useVirtualList;
{
"name": "ahooks",
"version": "3.1.9",
"version": "3.1.10",
"description": "react hooks library",

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

"license": "MIT",
"gitHead": "c177ec635369cee61204029f097695f862f35ab6"
"gitHead": "66b2b254ff885f44c46f13fe318e488ae64eab5d"
}

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