8000 Split overloaded 'use' method into multiple methods. · Issue #102 · tc39/proposal-explicit-resource-management · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Split overloaded 'use' method into multiple methods. #102
Closed
@rbuckton

Description

@rbuckton

Per the September 2022 plenary discussion, the DisposableStack.prototype.use method should not be overloaded and instead split into multiple methods:

  • use(disposable) to add a disposable resource to be disposed when the stack is disposed.
  • adopt(value, onDispose) to add a non-disposable resource (value), such that onDispose(value) is called when the stack is disposed.
  • defer(onDispose) to add a callback to execute when the stack is disposed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0