@jelper/hooks 0.1.1 → 0.2.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/README.md +29 -1
- package/es/index.js +1654 -90
- package/lib/index.js +1650 -88
- package/package.json +9 -7
- package/types/index.d.ts +20 -0
- package/types/useAsync.d.ts +13 -0
- package/types/useBoolState.d.ts +2 -0
- package/types/useCreate.d.ts +2 -0
- package/types/useDebounce.d.ts +3 -0
- package/types/useInterval.d.ts +2 -0
- package/types/useIsUnmount.d.ts +2 -0
- package/types/useListener.d.ts +2 -0
- package/types/useMount.d.ts +2 -0
- package/types/useParamsState.d.ts +6 -0
- package/types/useResizeObserver.d.ts +1 -0
- package/types/useRtCb.d.ts +2 -0
- package/types/useRtEffect.d.ts +2 -0
- package/types/useRtRef.d.ts +2 -0
- package/types/useRtState.d.ts +6 -0
- package/types/useSafeCb.d.ts +2 -0
- package/types/useSafeState.d.ts +3 -0
- package/types/useThrottle.d.ts +10 -0
- package/types/useTimeout.d.ts +8 -0
- package/types/useUnmount.d.ts +2 -0
- package/types/useUpdateEffect.d.ts +1 -0
package/README.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
1
|
# @jelper/hooks
|
|
2
2
|
|
|
3
|
-
react
|
|
3
|
+
react基础hooks工具包
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
``` bash
|
|
8
|
+
npm install @jelper/hooks --save
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 使用
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
|
|
15
|
+
import { useXxx } from '@jelper/hooks';
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## API
|
|
20
|
+
|
|
21
|
+
### useSafeState
|
|
22
|
+
|
|
23
|
+
说明
|
|
24
|
+
|
|
25
|
+
用法同 useState, 当调用组件销毁时,不再更新 state
|
|
26
|
+
|
|
27
|
+
### useSafeCb
|
|
28
|
+
|
|
29
|
+
用法同 useCallback, 当调用组件销毁时,不再执行回调函数
|
|
30
|
+
|
|
31
|
+
|