@lemon-fe/hooks 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.d.ts CHANGED
@@ -6,5 +6,7 @@ export { default as useRequest } from './use-request';
6
6
  export { default as useAsyncEffect } from './use-async-effect';
7
7
  export { default as usePreload } from './use-preload';
8
8
  export { default as useUpdateEffect } from './use-update-effect';
9
- export { default as useLastestRef } from './use-latest-ref';
9
+ export {
10
+ /** 兼容 */
11
+ default as useLastestRef, default as useLatestRef, } from './use-latest-ref';
10
12
  export { config, HooksConfigContext, HooksConfigProvider, type HooksOpts } from './config';
package/es/index.js CHANGED
@@ -6,5 +6,6 @@ export { default as useRequest } from "./use-request";
6
6
  export { default as useAsyncEffect } from "./use-async-effect";
7
7
  export { default as usePreload } from "./use-preload";
8
8
  export { default as useUpdateEffect } from "./use-update-effect";
9
- export { default as useLastestRef } from "./use-latest-ref";
9
+ export { /** 兼容 */
10
+ default as useLastestRef, default as useLatestRef } from "./use-latest-ref";
10
11
  export { config, HooksConfigContext, HooksConfigProvider } from "./config";
@@ -1,2 +1,2 @@
1
- /// <reference types="lodash" />
2
- export default function useDebounce<T extends (...args: any[]) => any>(cb: T, duration: number): import("lodash").DebouncedFunc<T>;
1
+ import type { DebounceSettings } from 'lodash';
2
+ export default function useDebounce<T extends (...args: any[]) => any>(cb: T, duration: number, opts?: DebounceSettings): import("lodash").DebouncedFunc<T>;
@@ -1,9 +1,9 @@
1
1
  import { useRef, useCallback } from 'react';
2
2
  import debounce from 'lodash/debounce';
3
- export default function useDebounce(cb, duration) {
3
+ export default function useDebounce(cb, duration, opts) {
4
4
  var ref = useRef(cb);
5
5
  ref.current = cb;
6
6
  return useCallback(debounce(function () {
7
7
  return ref.current.apply(ref, arguments);
8
- }, duration), []);
8
+ }, duration, opts), []);
9
9
  }
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export default function useLastestRef<T>(value: T): import("react").MutableRefObject<T>;
2
+ export default function useLatestRef<T>(value: T): import("react").MutableRefObject<T>;
@@ -1,5 +1,5 @@
1
1
  import { useRef } from 'react';
2
- export default function useLastestRef(value) {
2
+ export default function useLatestRef(value) {
3
3
  var ref = useRef(value);
4
4
  ref.current = value;
5
5
  return ref;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/hooks",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "> TODO: description",
5
5
  "author": "lusj",
6
6
  "homepage": "",
@@ -30,5 +30,5 @@
30
30
  "antd": "^4.24.8",
31
31
  "react": "^17.0.2"
32
32
  },
33
- "gitHead": "793ddaa1c937e067e29b649e5c04b377d3693b4e"
33
+ "gitHead": "804c56e7ca26df410ba801265e29ea06deb4b715"
34
34
  }