Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@flexbase/observable-subject

Package Overview
Dependencies
Maintainers
4
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flexbase/observable-subject

Observable subject event bus

latest
Source
npmnpm
Version
2.1.2
Version published
Weekly downloads
4
-94.87%
Maintainers
4
Weekly downloads
 
Created
Source

observable-subject

Coverage Quality Gate Status

Observable subject event bus

Installation

npm install @flexbase/observable-subject

or

yarn add @flexbase/observable-subject

Usage

import { Subject, subjectManager } from '@flexbase/observable-subject';

// create a subject
const subject: Subject = { key: Symbol() };

// register the subject
await subjectManager.register(subject);

// subscribe to the subject
const subscription = subjectManager.subscribe<number>(subject, async context => {
  await new Promise(_ => setTimeout(_, context.value));
});

// notify subscriptions
await subjectManager.notify(subject, { value: 1000 });

// unsubscribe
subscription.unsubscribe();

Keywords

flexbase

FAQs

Package last updated on 06 Dec 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