I alway do something like this for initial processes:
$.when(dom(), webrtc(), websocket('wss://example.com/'), sleep(3000)).then(load, fail);
dom
, webrtc
, websocket
, and sleep
are Promise objects. This expression is useful to load some parallel processes for initiation.
Now I am wondering how I can express these things by Bacon.js, a way of functional reactive programming.
Any idea would be appreciated. Thanks in advance.