End stream after $ element have been removed
See original GitHub issueWouldn’t it be nice to end stream obtained from $el.asEventStream method after $el have been removed?
Not sure I’m undersood your code right but check this:
Bacon.$.asEventStream = (eventName, selector, eventTransformer) ->
[eventTransformer, selector] = [selector, undefined] if isFunction(selector)
withDescription(@selector or this, "asEventStream", eventName, Bacon.fromBinder (handler) =>
@on('remove', -> handler new Bacon.End)
@on(eventName, selector, handler)
=> @off(eventName, selector, handler)
, eventTransformer)
Issue Analytics
- State:
- Created 9 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
How to remove the last element from a Stream Collection ...
This loop iterates over the images and removes an image as soon as a more recent matching object has been found, without the...
Read more >Operating on and Removing an Item from Stream | Baeldung
Learn about the various ways in which we can operate on an item in a Java 8 Stream and then remove it once...
Read more >Remove all elements after a certain element from a stream in ...
I want to remove all elements after a certain element from a stream in java. So for example if the list is this...
Read more >Stream (Java Platform SE 8 ) - Oracle Help Center
Streams have a BaseStream. close() method and implement AutoCloseable , but nearly all stream instances do not actually need to be closed after...
Read more >Audio and Video Delivery - Developer guides - MDN Web Docs
For further info see <video> element and Creating a cross-browser video ... alert('There has been a problem retrieving the streams - are you ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Also, while this might be convenient for the cases where you do want to end the stream on removal, it’s only marginally more code to write it explicitly yourself:
Yeah when put like that it makes a lot of sense. Thanks @johannhof .