1.1.23 • Published 9 months ago

juln-hooks v1.1.23

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

juln-hooks

实用的 react-hooks 和 react-help 集合(已完全支持 tree-shaking)

可以算是对 ahooks 的补充, 建议两者结合使用, 需要哪些用哪些

安装

npm i juln-hooks -S or yarn add juln-hooks -S

通用 hooks

useMount

useUnMount

useCheckUnMounted

useIsBrowser

useDebounceState

useThrottleState

defineStore

基于 recoil, 更舒服的编写 store

externalState

支持组件外部控制组件内部的状态 (首推 reducer 的操作方式)

目的: externalState 的目的是为了减轻大项目中的 store

特点:

  1. 便于极大减轻大项目中的 store
  2. 方便使用, 上手难度低
  3. 支持超强的 ts 类型提示, dispatch 的任何参数都能得到最严格的约束

适用于哪些 state: 有些状态只是用于简单的组件穿透的, 逻辑上并不属于 store, 如一个 Modal,很多地方都能去控制它, 但是逻辑上不应该属于 store

通用 react-help

reactNodeArray_join

native-jsx

将 jsx 编译成 document.createElement

特殊 hooks

useLockRatio

useFloatHandler

useAutoFontSize

1.1.23

9 months ago

1.1.22

9 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.1.9

10 months ago

1.1.8

10 months ago

1.0.9

10 months ago

1.1.7

10 months ago

1.0.8

10 months ago

1.1.6

10 months ago

1.0.7

10 months ago

1.1.5

10 months ago

1.0.6

10 months ago

1.1.4

10 months ago

1.0.5

10 months ago

1.1.3

10 months ago

1.0.4

10 months ago

1.1.2

10 months ago

1.1.12

10 months ago

1.1.11

10 months ago

1.1.10

10 months ago

1.1.16

9 months ago

1.1.15

10 months ago

1.1.13

10 months ago

1.1.19

9 months ago

1.1.18

9 months ago

1.1.17

9 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.1.21

9 months ago

1.1.20

9 months ago

1.0.12

10 months ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago