Comparing version 2.2.0 to 2.3.0
@@ -45,2 +45,3 @@ import useRequest, { UseRequestProvider } from '@ahooksjs/use-request'; | ||
import useDebounceEffect from './useDebounceEffect'; | ||
import useCookieState from './useCookieState'; | ||
import useSetState from './useSetState'; | ||
@@ -51,2 +52,2 @@ import useInterval from './useInterval'; | ||
declare const useControlledValue: typeof useControllableValue; | ||
export { useControlledValue, 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, useRequest, UseRequestProvider, useAntdTable, useUnmount, useSet, usePersistFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useFusionTable, useSetState, useInterval, useWhyDidYouUpdate, useTitle, }; | ||
export { useControlledValue, 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, useRequest, UseRequestProvider, useAntdTable, useUnmount, useSet, usePersistFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useFusionTable, useCookieState, useSetState, useInterval, useWhyDidYouUpdate, useTitle, }; |
@@ -80,2 +80,3 @@ var __read = this && this.__read || function (o, n) { | ||
import useDebounceEffect from './useDebounceEffect'; | ||
import useCookieState from './useCookieState'; | ||
import useSetState from './useSetState'; | ||
@@ -97,2 +98,2 @@ import useInterval from './useInterval'; | ||
export { useControlledValue, 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, useRequest, UseRequestProvider, useAntdTable, useUnmount, useSet, usePersistFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useFusionTable, useSetState, useInterval, useWhyDidYouUpdate, useTitle }; | ||
export { useControlledValue, 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, useRequest, UseRequestProvider, useAntdTable, useUnmount, useSet, usePersistFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useFusionTable, useCookieState, useSetState, useInterval, useWhyDidYouUpdate, useTitle }; |
@@ -10,2 +10,2 @@ export interface Options<T> { | ||
} | ||
export default function useControllableValue<T>(props?: Props, options?: Options<T>): readonly [T, (v: T | undefined) => void]; | ||
export default function useControllableValue<T>(props?: Props, options?: Options<T>): readonly [T | undefined, (v: T | undefined) => void]; |
@@ -10,3 +10,3 @@ interface EventTarget<U> { | ||
} | ||
declare function useEventTarget<T, U = T>(params?: Params<T, U>): readonly [T, { | ||
declare function useEventTarget<T, U = T>(params?: Params<T, U>): readonly [T | undefined, { | ||
readonly onChange: (e: EventTarget<U>) => void; | ||
@@ -13,0 +13,0 @@ readonly reset: () => void; |
@@ -13,3 +13,3 @@ import { BasicTarget } from '../utils/dom'; | ||
declare type Result = [Value, Callback]; | ||
declare const _default: (target: BasicTarget, options?: Options) => Result; | ||
declare const _default: (target: BasicTarget, options?: Options | undefined) => Result; | ||
export default _default; |
export default function useHistoryTravel<T>(initialValue?: T): { | ||
value: T; | ||
value: T | undefined; | ||
setValue: (val: T) => void; | ||
@@ -4,0 +4,0 @@ backLength: number; |
@@ -6,3 +6,3 @@ import { BasicTarget } from '../utils/dom'; | ||
} | ||
declare const _default: (target: BasicTarget, options?: Options) => boolean; | ||
declare const _default: (target: BasicTarget, options?: Options | undefined) => boolean; | ||
export default _default; |
export declare type compareFunction<T> = (prev: T | undefined, next: T) => boolean; | ||
declare const _default: <T>(state: T, compare?: compareFunction<T>) => T; | ||
declare const _default: <T>(state: T, compare?: compareFunction<T> | undefined) => T | undefined; | ||
export default _default; |
import { MutableRefObject } from 'react'; | ||
export declare type BasicTarget<T = HTMLElement> = (() => T | null) | T | null | MutableRefObject<T | undefined>; | ||
declare type TargetElement = HTMLElement | Document | Window; | ||
export declare function getTargetElement(target?: BasicTarget<TargetElement>, defaultElement?: TargetElement): TargetElement | undefined; | ||
export declare function getTargetElement(target?: BasicTarget<TargetElement>, defaultElement?: TargetElement): TargetElement | undefined | null; | ||
export {}; |
@@ -45,2 +45,3 @@ import useRequest, { UseRequestProvider } from '@ahooksjs/use-request'; | ||
import useDebounceEffect from './useDebounceEffect'; | ||
import useCookieState from './useCookieState'; | ||
import useSetState from './useSetState'; | ||
@@ -51,2 +52,2 @@ import useInterval from './useInterval'; | ||
declare const useControlledValue: typeof useControllableValue; | ||
export { useControlledValue, 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, useRequest, UseRequestProvider, useAntdTable, useUnmount, useSet, usePersistFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useFusionTable, useSetState, useInterval, useWhyDidYouUpdate, useTitle, }; | ||
export { useControlledValue, 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, useRequest, UseRequestProvider, useAntdTable, useUnmount, useSet, usePersistFn, useMap, useCreation, useDrag, useDrop, useMount, useCounter, useUpdate, useTextSelection, useEventTarget, useHistoryTravel, useFusionTable, useCookieState, useSetState, useInterval, useWhyDidYouUpdate, useTitle, }; |
@@ -81,3 +81,3 @@ "use strict"; | ||
}); | ||
exports.useTitle = exports.useWhyDidYouUpdate = exports.useInterval = exports.useSetState = exports.useFusionTable = exports.useHistoryTravel = exports.useEventTarget = exports.useTextSelection = exports.useUpdate = exports.useCounter = exports.useMount = exports.useDrop = exports.useDrag = exports.useCreation = exports.useMap = exports.usePersistFn = exports.useSet = exports.useUnmount = exports.useAntdTable = exports.UseRequestProvider = exports.useRequest = 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.useControlledValue = void 0; | ||
exports.useTitle = exports.useWhyDidYouUpdate = exports.useInterval = exports.useSetState = exports.useCookieState = exports.useFusionTable = exports.useHistoryTravel = exports.useEventTarget = exports.useTextSelection = exports.useUpdate = exports.useCounter = exports.useMount = exports.useDrop = exports.useDrag = exports.useCreation = exports.useMap = exports.usePersistFn = exports.useSet = exports.useUnmount = exports.useAntdTable = exports.UseRequestProvider = exports.useRequest = 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.useControlledValue = void 0; | ||
@@ -288,2 +288,6 @@ var use_request_1 = __importStar(require("@ahooksjs/use-request")); | ||
var useCookieState_1 = __importDefault(require("./useCookieState")); | ||
exports.useCookieState = useCookieState_1["default"]; | ||
var useSetState_1 = __importDefault(require("./useSetState")); | ||
@@ -290,0 +294,0 @@ |
@@ -10,2 +10,2 @@ export interface Options<T> { | ||
} | ||
export default function useControllableValue<T>(props?: Props, options?: Options<T>): readonly [T, (v: T | undefined) => void]; | ||
export default function useControllableValue<T>(props?: Props, options?: Options<T>): readonly [T | undefined, (v: T | undefined) => void]; |
@@ -10,3 +10,3 @@ interface EventTarget<U> { | ||
} | ||
declare function useEventTarget<T, U = T>(params?: Params<T, U>): readonly [T, { | ||
declare function useEventTarget<T, U = T>(params?: Params<T, U>): readonly [T | undefined, { | ||
readonly onChange: (e: EventTarget<U>) => void; | ||
@@ -13,0 +13,0 @@ readonly reset: () => void; |
@@ -13,3 +13,3 @@ import { BasicTarget } from '../utils/dom'; | ||
declare type Result = [Value, Callback]; | ||
declare const _default: (target: BasicTarget, options?: Options) => Result; | ||
declare const _default: (target: BasicTarget, options?: Options | undefined) => Result; | ||
export default _default; |
export default function useHistoryTravel<T>(initialValue?: T): { | ||
value: T; | ||
value: T | undefined; | ||
setValue: (val: T) => void; | ||
@@ -4,0 +4,0 @@ backLength: number; |
@@ -6,3 +6,3 @@ import { BasicTarget } from '../utils/dom'; | ||
} | ||
declare const _default: (target: BasicTarget, options?: Options) => boolean; | ||
declare const _default: (target: BasicTarget, options?: Options | undefined) => boolean; | ||
export default _default; |
export declare type compareFunction<T> = (prev: T | undefined, next: T) => boolean; | ||
declare const _default: <T>(state: T, compare?: compareFunction<T>) => T; | ||
declare const _default: <T>(state: T, compare?: compareFunction<T> | undefined) => T | undefined; | ||
export default _default; |
import { MutableRefObject } from 'react'; | ||
export declare type BasicTarget<T = HTMLElement> = (() => T | null) | T | null | MutableRefObject<T | undefined>; | ||
declare type TargetElement = HTMLElement | Document | Window; | ||
export declare function getTargetElement(target?: BasicTarget<TargetElement>, defaultElement?: TargetElement): TargetElement | undefined; | ||
export declare function getTargetElement(target?: BasicTarget<TargetElement>, defaultElement?: TargetElement): TargetElement | undefined | null; | ||
export {}; |
{ | ||
"name": "ahooks", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "react hooks library", | ||
@@ -34,4 +34,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@ahooksjs/use-request": "^2.2.0", | ||
"@ahooksjs/use-request": "^2.3.0", | ||
"@types/js-cookie": "^2.2.6", | ||
"intersection-observer": "^0.7.0", | ||
"js-cookie": "^2.2.1", | ||
"lodash.debounce": "^4.0.8", | ||
@@ -38,0 +40,0 @@ "lodash.isequal": "^4.5.0", |
@@ -33,4 +33,45 @@ English | [简体中文](https://github.com/alibaba/hooks/blob/master/README.zh-CN.md) | ||
## 🖥 Development | ||
## Core Team | ||
<table> | ||
<tbody> | ||
<tr> | ||
<td align="center"> | ||
<a target="_blank" href="https://github.com/alibaba/ice"> | ||
<img | ||
width="32" | ||
src="https://img.alicdn.com/tfs/TB1Jd.tb79l0K4jSZFKXXXFjpXa-482-264.png" | ||
/> | ||
<br> | ||
<strong>ice</strong> | ||
</a> | ||
</td> | ||
<td align="center"> | ||
<a target="_blank" href="https://github.com/umijs/umi"> | ||
<img | ||
width="32" | ||
style="vertical-align: -0.32em; margin-right: 8px;" | ||
src="https://img.alicdn.com/tfs/TB1fhqaLAT2gK0jSZFkXXcIQFXa-132-130.png" | ||
/> | ||
<br> | ||
<strong>umi</strong> | ||
</a> | ||
</td> | ||
<td align="center"> | ||
<a target="_blank" href="https://www.alisports.com/"> | ||
<img | ||
width="32" | ||
style="vertical-align: -0.32em; margin-right: 8px;" | ||
src="https://gw.alicdn.com/tfs/TB13XKjLuL2gK0jSZFmXXc7iXXa-205-59.png" | ||
/> | ||
<br> | ||
<strong>Alisports</strong> | ||
</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
## 🤝 Contributing | ||
``` | ||
@@ -44,4 +85,2 @@ $ git clone git@github.com:alibaba/hooks.git | ||
## 🤝 Contributing | ||
We welcome all contributions, please read our [CONTRIBUTING.MD](https://github.com/alibaba/hooks/blob/master/CONTRIBUTING.MD) first, let's build a better hooks library together. | ||
@@ -48,0 +87,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
329018
231
7996
100
7
10
+ Added@types/js-cookie@^2.2.6
+ Addedjs-cookie@^2.2.1
+ Added@types/js-cookie@2.2.7(transitive)
+ Addedjs-cookie@2.2.1(transitive)
Updated@ahooksjs/use-request@^2.3.0