vuex-wait
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

vuex-wait

Adds loading state for actions to Vuex automatically. You don't need to maintain asynchronous action state any more. Inspired by dva-loading.

Install

npm install vuex-wait --save

Usage

import Vue from 'vue';
import Vuex from 'vuex';
import createLoading from 'vuex-wait';
 
Vue.use(Vuex);
 
const options = {};
const store = new Vuex.Store({
  plugins: [ createLoading(options) ]
});

Then we can access loading state from store.

Options

name

{ name: 'girl' }

In which case, loading can be accessed from store.state.girl

Defaults to loading

State Structure

{
  loading: {
    global: false,
    actions: {
      increment: false,
      incrementAsync: false
    }
  }
}

License

MIT

Dependents (0)

Package Sidebar

Install

npm i vuex-wait

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

42.7 kB

Total Files

10

Last publish

Collaborators

  • maiwenan