This package has been deprecated

Author message:

deprecated

@reactive-js/disposable
TypeScript icon, indicating that this package has built-in type declarations

0.0.37 • Public • Published

@reactive-js/disposable

Utilities for managing the lifetimes of resources and composing their disposal semantics.

Installation

via npm

npm install @reactive-js/disposable

via yarn

yarn add @reactive-js/disposable

Usage

import { createDisposable } from "@reactive-js/disposable";

const arr = new Array(1000);
const onDispose = () => {
  arr.length = 0;
};
const disposable = createDisposable();
disposable.add(onDispose);

// ...sometime in the future

disposable.dispose();
// guaranteed that onDispose is only ever called once.

Documentation

API documentation is available here.

Package Sidebar

Install

npm i @reactive-js/disposable

Weekly Downloads

3

Version

0.0.37

License

MIT

Unpacked Size

19.5 kB

Total Files

11

Last publish

Collaborators

  • bordoley