@lemon-fe/hooks 0.0.18 → 0.0.21

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.
@@ -1,5 +1,5 @@
1
1
  import { useRef, useCallback } from 'react';
2
- import { debounce } from 'lodash';
2
+ import debounce from 'lodash/debounce';
3
3
  export default function useDebounce(cb, duration) {
4
4
  var ref = useRef(cb);
5
5
  ref.current = cb;
@@ -12,7 +12,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
13
  import { useState, useEffect } from 'react';
14
14
  import { ConfigProvider } from 'antd';
15
- import { isEqual } from 'lodash';
15
+ import isEqual from 'lodash/isEqual';
16
16
  import colorString from 'color-string';
17
17
  import Subject from '../subject';
18
18
  var primaryColor = getComputedStyle(document.documentElement).getPropertyValue('--ant-primary-color').trim();
@@ -16,7 +16,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
 
17
17
  import React, { useRef, useEffect, useMemo, useState } from 'react';
18
18
  import { message, Result, Button, Spin } from 'antd';
19
- import { debounce, throttle } from 'lodash';
19
+ import debounce from 'lodash/debounce';
20
+ import throttle from 'lodash/debounce';
20
21
  /**
21
22
  * 发起网络请求, 主要面向场景: 提交单据、点击列表打开详情页前请求数据,自动捕获异常
22
23
  * @param request 网络请求方法
@@ -1,2 +1,2 @@
1
- import { ThrottleSettings } from 'lodash';
1
+ import type { ThrottleSettings } from 'lodash';
2
2
  export default function useThrottle<T extends (...args: any[]) => any>(cb: T, duration: number, options?: ThrottleSettings): import("lodash").DebouncedFunc<T>;
@@ -5,7 +5,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
7
  import { useRef, useCallback } from 'react';
8
- import { throttle } from 'lodash';
8
+ import throttle from 'lodash/throttle';
9
9
  export default function useThrottle(cb, duration, options) {
10
10
  var ref = useRef(cb);
11
11
  ref.current = cb;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/hooks",
3
- "version": "0.0.18",
3
+ "version": "0.0.21",
4
4
  "description": "> TODO: description",
5
5
  "author": "鲁盛杰 <lusj@cnlemon.net>",
6
6
  "homepage": "",
@@ -25,5 +25,5 @@
25
25
  "devDependencies": {
26
26
  "@types/color-string": "^1.5.2"
27
27
  },
28
- "gitHead": "c362fb139da0f18abcafb4d07bf1e265957306d0"
28
+ "gitHead": "800cd94fab88bdc749dc65602b9d15abbb89691d"
29
29
  }