Skip to content

Auto loading plugin for dva, you don't need to write showLoading and hideLoading any more.

Notifications You must be signed in to change notification settings

feibyte/dva-loading

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dva-loading

NPM version Build Status Coverage Status NPM downloads

Auto loading plugin for dva. 👏 You don't need to write showLoading and hideLoading any more.


Install

$ npm install dva-loading --save

Usage

import createLoading from 'dva-loading';

const app = dva();
app.use(createLoading(opts));

Then we can access loading state from store.

opts

  • opts.namespace: property key on global state, type String, Default loading

See real project usage on dva-hackernews.

  • opts.effects: enable effects level loading state

State Structure

loading: {
  global: false,
  models: {
    users: false,
    todos: false,
    ...
  },
}

License

MIT

About

Auto loading plugin for dva, you don't need to write showLoading and hideLoading any more.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.7%
  • Makefile 2.3%