statehook.js A state hook. Installation $ npm install statehook API StateHook.createHook([defaultValue]) Create a hook var hook = StateHook.createHook(); // or var hook = StateHook.createHook('default value'); hook.setState(newState) => newState hook.getState() => any hook.subscribe(subscriber) => unsubcribe() hook.dispatch(args1, arg2, ..., argN) => void hook.discard() => void hook.isDiscarded() =>Boolean