I am new on RxJS and angular2, my goal is develop a shared function to prevent racing between model update and saving data to database without using blockui
My rough idea is:
initial state is "unfreeze"
1. Parent send "freeze" to children
2. Child components "block" all their internal dom event queues
3. Parent wait for all outstanding async operations (including
children) to complete
4. Parent save model data into database
5. Parent send "unfreeze" to children, and child component unblock their queues
but do not know how it can be done in RxJS world
(observable) signal -> "freeze"/"unfreeze" from parent component
(observable) target queue ->
When "freeze", either (choice of children component)
a. buffer all events (e.g. keystroke)
b. drop all events (e.g. mouse click)
c. keep last event (e.g. windows resize)
until "unfreeze"
When "unfreeze", no buffering or filtering, forward event ASAP, until "freeze"
Thank you very much