Destroy a hook
import { CounterStore } from 'counter-store';
function YourController($scope, counterStore) {
const hookLink = counterStore.hook('INCREMENT_COUNT', (state) => {
$scope.count = state.count;
if ($scope.count === 10) {
hookLink.destroy();
}
});
}
angular
.module('App', [])
.controller('YourController', YourController);import { CounterStore } from 'counter-store';
function YourController($scope, counterStore) {
counterStore.hook('INCREMENT_COUNT', (state) => {
$scope.count = state.count;
}).destroyOn($scope);
}
angular
.module('App', [])
.controller('YourController', YourController);Last updated
Was this helpful?