Skip to content

Commit e61ae90

Browse files
author
Illia Osmanov
committed
added clearAll action for remove all loading states
1 parent 95dab7e commit e61ae90

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stfalcon/vuex-loading-plugin",
3-
"version": "1.1.2",
3+
"version": "1.2.0",
44
"description": "Lightweight plugin for handle loading before and after action request",
55
"main": "src/index.js",
66
"scripts": {

src/modules/turns.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,14 @@ export default {
2323
(_, idx, arr) => idx !== arr.indexOf(moduleName)
2424
);
2525
}
26+
},
27+
28+
actions: {
29+
clearAll({ state, commit }) {
30+
state.turns.forEach(turn => {
31+
commit(`${turn}/SET_LOADING`, false, { root: true });
32+
commit('REMOVE_TURN', turn);
33+
})
34+
}
2635
}
2736
};

0 commit comments

Comments
 (0)