2.1.1 • Published 2 years ago

@fvilers/disposable v2.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

disposable

Provide a mechanism for releasing resources

Installation

npm install @fvilers/disposable

or

yarn add @fvilers/disposable

ECMAScript module

Starting with version 2.0.0, this library will be published as an ECMAScript module.

Usage

import { Disposable, using } from "@fvilers/disposable";

class Foo implements Disposable {
  doSomething() {
    console.log("I'm doing something");
  }

  dispose() {
    console.log("I'm now disposed");
  }
}

using(new Foo(), (foo) => {
  foo.doSomething();
});
Hello, world!
I'm now disposed
2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.0

3 years ago