I am building a mediaplayer-like application using reactive-banana.
Let's say I want a Behavior
that represents the currently selected track in
the track list.
I have two options: use fromPoll
to get the current selection when it's
needed; or use fromChanges
and subscribe to the selection change event.
I use the selected track Behavior
only when the user presses the "Play"
button. This event is much more rare than a selection change.
Given that, I'd assume that fromPoll
would be better/more efficient
than fromChanges
in this situation. But the docs say that "the
recommended way to obtain Behavior
s is by using fromChanges
".
Does it still apply here? I.e. will the polling action be executed more often than it is actually used (sampled) by the network?