These are chat archives for pozadi/kefir

11th
Mar 2015
Jared Forsyth
@jaredly
Mar 11 2015 15:14
Is there a function like merge() that completes as soon as any of the streams complete?
Right now I'm doing a hack with one.merge(other).takeUntilBy(other)
Roman Pominov
@rpominov
Mar 11 2015 16:41
@jaredly no, no such method at the moment
Jared Forsyth
@jaredly
Mar 11 2015 16:42
Does that sounds like a generally desirable thing? Should I PR, or just keep the hack?
Roman Pominov
@rpominov
Mar 11 2015 16:43
I'd say so, but not sure yet how it should look in API.
Jared Forsyth
@jaredly
Mar 11 2015 16:44
As in what name it should have? for functionality, I think basically the same signature as merge, it just completes earlier
Roman Pominov
@rpominov
Mar 11 2015 16:45
I.e. should we add method similar to .merge(), or perhaps something like Kefir.emitValueWhenAnyOfThouseEnd(observables, value)
Jared Forsyth
@jaredly
Mar 11 2015 16:46
Oh interesting. Then you could just takeUntilBy(emitVal....)
Roman Pominov
@rpominov
Mar 11 2015 16:48
I think it all pretty general to be in the core, but will not be used frequently, which is another condition for things to be added to core.
Jared Forsyth
@jaredly
Mar 11 2015 16:49
sure
Roman Pominov
@rpominov
Mar 11 2015 16:49
Will think about it, though.
Roman Pominov
@rpominov
Mar 11 2015 16:56
@jaredly what is your use case, btw? :)
never needed this myself, and never heard anyone need it
Jared Forsyth
@jaredly
Mar 11 2015 16:58
drag-n-drop. mouseMove.mergeUntilAny(mouseUp.take(1)). It's easy to do another way, with mouseMove.takeUntilBy(mouseUp.take(1)).merge(mouseUp.take(1)), but more verbose.
Roman Pominov
@rpominov
Mar 11 2015 17:03
thanks, will think about it.