8000 Make Observable disposable · Issue #150 · WICG/observable · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Make Observable disposable #150
Open
@jasnell

Description

@jasnell

It would be useful for the Observable class to support the upcoming Symbol.dispose or Symbol.asyncDispose mechanism (TC39 Explicit Resource Management proposal) such that when the Observable is disposed while still active, any outstanding subscriptions and closed and outstanding promises are rejected.

using obs1 = eventTarget.on('foo');
using obs2 = Observable.from(asyncIterable);

This is particularly helpful in cases where a block of code may wish to only temporarily attach itself to a particular event source (like an EventTarget that long outlives the Observable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    possible future enhancementAn enhancement that doesn't block standardization or shipping

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0