Update the state
import { CounterStore } from 'counter-store';
function YourController(counterStore) {
let currentState;
currentState = counterStore.copy();
counterStore.dispatch('INCREMENT_COUNT', {
count: currentState.count + 1;
});
currentState = counterStore.copy();
counterStore.dispatch('DECREMENT_COUNT', {
count: currentState.count - 1;
});
}
angular
.module('App', [])
.controller('YourController', YourController);Last updated
Was this helpful?