@hazae41/disposer
Advanced tools
Comparing version 2.0.10 to 2.0.11
{ | ||
"type": "module", | ||
"name": "@hazae41/disposer", | ||
"version": "2.0.10", | ||
"version": "2.0.11", | ||
"description": "Helpers for Disposable", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/hazae41/disposer", |
# Disposer | ||
Helpers for Disposable | ||
A wrapper for an object with a dispose function | ||
@@ -17,4 +17,2 @@ ```bash | ||
- Create a disposable object from any object | ||
- Create a thenable disposable object from a thenable object | ||
- Race multiple thenable and disposable objects | ||
@@ -33,5 +31,12 @@ ## Usage | ||
You can get the inner object with `.inner` or `.get()` and the dispose function with `.dispose` | ||
## Example | ||
This can be useful for waiting for multiple listeners, and remove all listeners when one of them is triggered | ||
```tsx | ||
import { Future } from "@hazae41/future" | ||
import { Disposer } from "@hazae41/disposer" | ||
function waitA(): Disposer<Promise<"a">> { | ||
@@ -38,0 +43,0 @@ const future = new Future<"a">() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9577
71