febrestjs
Install with npm:
npm i febrest -S
Install with yarn
yarn add febrest
dispatch(action:string|(payload?:any)=>any,payload?:any)=>Promise<any>
example:
dispatch(d=>{console.log(d);return d;},'hello world').then(data=>{console.log(data)})
action(namespace?:string,controllerMap:<string,(payload:any)=>any>{});
example
let controller = {
init:()=>console.log('appinit')
}
Febrest.action('app',controller)
Febrest.dispatch('app.init')
// or
Febrest.action(controller)
Febrest.dispatch('init')
plugin(plugin:{initialized:(action)=>any,close:(action)=>any});
subscribe(callback:(data:{cmd:string,data:any})=>any);
unsubscribe(callback:(data:{cmd:string,data:any})=>any);
watch(callback:(changed)=>{remove:()=>void});
onError(callback:(error)=>any);