Code Monkey home page Code Monkey logo

juln-hooks's Introduction

juln-hooks

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

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

安装

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

useMount

useUnMount

useCheckUnMounted

useIsBrowser

useDebounceState

useThrottleState

基于 recoil, 更舒服的编写 store

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

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

特点:

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

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

reactNodeArray_join

将 jsx 编译成 document.createElement

useLockRatio

useFloatHandler

useAutoFontSize

juln-hooks's People

Watchers

juln avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.