Listen on state changes
import { CounterStore } from 'counter-store';
function YourController($scope, counterStore) {
counterStore.hook('INCREMENT_COUNT', (state) => {
$scope.count = state.count;
});
counterStore.hook('DECREMENT_COUNT', ({ count }) => {
$scope.count = count;
});
}
angular
.module('App', [])
.controller('YourController', YourController);Last updated
Was this helpful?