New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

unsubscriber

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unsubscriber

How to easy collect unsubscribe functions from several sources

latest
Source
npmnpm
Version
2.2.0
Version published
Weekly downloads
164
-11.83%
Maintainers
1
Weekly downloads
 
Created
Source

unsubscriber

npm version bundle size code coverage typescript supported

How to easy collect unsubscribe functions from several sources.

import { unsubscriber, collect, attach, run, scope, un } from "unsubscriber";

const unsubs = unsubscriber();

// Run code and collect unsubscribers
const app = collect(usubs, () => {
  un(() => {
    console.log('unsubscribe');
  });

  attach(scope(), () => {});
  return new App();
});

const detach = attach(usubs, () => {});

run(usubs);

Context dependent functions who available into the function body:

const app = collect(usubs, () => {

  const detach = un(unsubscriber);

});

Enjoy your code!

Keywords

unsubscribe

FAQs

Package last updated on 30 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts