Giter Club home page Giter Club logo

async-modal's Introduction

AsyncModal

基于React Antd组件库的Modal组件,封装为异步调用逻辑。

异步Modal的优势

  • 可在async function随处调用,保持同步逻辑。尤其在事件回调中有流程化执行逻辑时,保持执行顺序。

  • 省去在jsx中声明modal组件及visible state管理,代码简化,可维护性增强。

  • Modal内容和Modal框分离,一个内容组件既可以在Page中使用,也可以在Modal中直接复用。只需要用asyncModalify包裹内容组件即可。

  • 每次Modal展示都会重新渲染内容组件,适合无需保持已填内容的场景。

  • 提供类似window.alert window.confirm原生api的调用体验。

使用示例

可参见 async-modal.stories.tsx 中的示例代码。

async-modal's People

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.