unsubscribe after model.apply?

20 views
Skip to first unread message

ry...@ryanberdeen.com

unread,
Sep 18, 2014, 1:25:55 PM9/18/14
to bac...@googlegroups.com
(copied from https://github.com/baconjs/bacon.model/issues/8)

I need to unsubscribe a model from a source added with model.apply.

The unplug function returned by bus.plug isn't returned (https://github.com/baconjs/bacon.model/blob/master/src/bacon.model.coffee#L47), so I can't see how to use the model without leaking memory.

Is this not a use-case of bacon.model? Is there a better way to get a stream that behaves like that returned by model.apply, where updates from the source stream are filtered?

Thanks!

Ryan

raimohanska

unread,
Sep 18, 2014, 1:40:32 PM9/18/14
to bac...@googlegroups.com, ry...@ryanberdeen.com
We might consider exposing the unplug function. Or you might try to apply a source with an end condition, like "model.apply(source.takeUntil(someEvent)".
Reply all
Reply to author
Forward
0 new messages