Giter Club home page Giter Club logo

simple-userequest's Introduction

手动实现 ahooks 中 useRequest

已完成部分:

  1. 实现自动请求和手动请求
  2. 实现请求取消
  3. 同步刷新
  4. 异步刷新
  5. loading 状态
  6. 生命周期函数
  7. 插件机制

功能分析

  1. 使用 useRequestImplement 实现具体逻辑
  2. 使用 useLatest 存储 service 函数
  3. 使用 useUpdate 刷新页面
  4. 使用 useCreation 保证 fetchInstance 实例单一
  5. 使用 Fetch类 实现具体请求逻辑和插件应用
  6. 使用 useMount 实现自动请求
  7. 使用 useUnmount 实现组件卸载时候自动取消请求
  8. 使用 useMemoizedFn 对函数进行持久化存储

simple-userequest's People

Stargazers

 avatar  avatar

Watchers

 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.