New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@zkochan/zen-push

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zkochan/zen-push

An Observable push stream

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

@zkochan/zen-push

A push stream observable class. (Sometimes called a Subject in Rx-speak.)

Install

npm install @zkochan/zen-push

Usage

import PushStream from '@zkochan/zen-push';

let pushStream = new PushStream();
pushStream.observable.subscribe(value => console.log(`Hello ${value}!`));
pushStream.next('World'); // 'Hello World!'

API

new PushStream ( )

let pushStream = new PushStream();

Creates a new PushStream object.

pushStream.observable

pushStream.observable.subscribe(value => console.log(`Hello ${value}!`));

The instance of Observable used to listen to elements in the push stream.

pushStream.next ( value )

pushStream.next('World');

Sends the next stream value to all observers.

pushStream.error ( error )

pushStream.error(new Error('The planet as been destroyed'));

Sends an error to all observers. Calling this method terminates the stream.

pushStream.complete ( )

pushStream.complete();

Sends a signal to all observers that the stream is finished. Calling this method terminates the stream.

License

MIT

FAQs

Package last updated on 01 Jan 2019

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

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