vuex-actions-states
v1.0.0
Published
Nuxt-module state manager for vuex actions.
Downloads
1
Readme
vuex-actions-states
Nuxt-module state manager for vuex actions.
Keeps track of your actions (dispatch methods):
initial
action has not yet been called.pending
at least one action call not yet completed.done
all action calls have been completed.
Also works in conjunction with vue-devtools.
Install
yarn add vuex-actions-states
// or
npm install vuex-actions-states
Setup
In nuxt.config.js
{
...otherImportantNuxtConfigStuff,
modules: [
[ 'vuex-actions-states']
]
}
Usage
An $actions
object is globally accessible via this
in components or $nuxt
.
###$actions.initial(actionName: String | String[])
String
: returns true if action has not been called yet.
String[]
: returns true if at least one action has not been called yet.
###$actions.pending(actionName: String | String[])
String
: returns true if action has not been completed yet.
String[]
: returns true if at least one action has not been completed yet.
###$actions.done(actionName: String | String[])
String
: returns true if action has not been completed yet.
String[]
: returns true if at least one action has not been completed yet.
###$actions.states
Returns vuex-store state.
Also accessed via this.$store.actionsStates.state
Options
module String: optional
Defaults to actionStates
.
Name for vuex store module.
mutation String: option
Defaults to setActionType
.
Name for vuex store mutation.
(note: most use cases can ignore options)