You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.
sleep - return action, when count of components use call useProvide or useSubscribe equal 0. Service is idle. idle - return boolean, true when count of subscribed (through useProvide or useSubscribe) component is 0 awake - return action, when count of components who use call useProvide or useSubscribe more then 0
classCounters{todo=provide(Todo);store={active: 0,completed: 0}constructor(){subscribe(this.todo,this.calculate,this);subscribe(TodoItemChanged,this.calculate,this);subscribe(awake(this),this.calculate,this);subscribe(sleep(this),this.sleep,this);this.calculate();}calculate(){if(idle(this))return;constitems=this.todo.store;constcompleted=items.filter(item=>item.store.completed).length;constactive=items.length-completed;this.store={ completed, active };}sleep(){console.log('sleep');}}
The text was updated successfully, but these errors were encountered:
sleep
- return action, when count of components use calluseProvide
oruseSubscribe
equal 0. Service is idle.idle
- return boolean, true when count of subscribed (throughuseProvide
oruseSubscribe
) component is 0awake
- return action, when count of components who use calluseProvide
oruseSubscribe
more then 0The text was updated successfully, but these errors were encountered: