Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hazae41/disposer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hazae41/disposer - npm Package Compare versions

Comparing version 2.0.10 to 2.0.11

2

package.json
{
"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">()

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc