These are chat archives for pozadi/kefir

Jun 2015
Peter Keše
Jun 20 2015 16:04
I also have a question regarding 'lack of' emitters. I'm building a video player that emits time events and several things observing those time events that may or may not be present (for example video player controls that may appear on mouse-over and hide on mouse-out, or an additional app that might report to google analytics when 10% of video is played).
In addition, the player is not there yet when I set up the page: depending on browser version and source, it might be my own html5 video component, a Flash applet or a wrapped youtube player (and they take time to load). So I need to connect this time event source when it gets available, but the API for event subscribers would ideally be there from the very start.
Peter Keše
Jun 20 2015 16:09
I'm currently using Rx.BehaviorSubject, but would prefer to switch to Kefir. However it is not clear, how to implement such functioality in Kefir.
Peter Keše
Jun 20 2015 16:23
Oh... I've seen the comment on ... However I thought that if I create my time property and subscribe to it before starting to emit events, then I wouldn't miss any events.
Juha Paananen
Jun 20 2015 19:44
pkese I think it would be nice that the API's for subscribing to any kind of Events/Properties would be there from the start, even before the player is initialized. To implement this without using a Bus (in Bacon.js terms) I'd expose the availability of the player as an EventStream or Property, say playerReady. Then I'd create any dependent streams by flatMapping from the playerReady event.