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

most-proxy

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

most-proxy

Circular Dependencies for most.js

  • 3.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65
increased by116.67%
Maintainers
3
Weekly downloads
 
Created
Source

Most Proxy

Create circular stream dependencies that is declarative and designed to avoid memory leaks.

This codebase is proudly written in TypeScript so you can enjoy beautiful typings.

Install

npm install --save most-proxy

Example

import { periodic } from 'most'
import { proxy } from 'most-proxy'

// create a proxy
// returns *attach* to attach proxy to another stream, and a proxy stream *stream*
const { attach, stream } = proxy()

// observe the proxy, taking only three events
// proxy is a real most.Stream
// when stream ends, original will also be disposed of internally
stream.take(3).observe(x => console.log(x)) // 1, 2, 3

// here we create the stream we want to use as the circular dependency
const original = periodic(100, 1).scan((x, y) => x + y, 0)

// pipe events from original to proxy stream
attach(original)

API Documentation

interface Proxy<T> {
  attach(stream: Stream<T>): Stream<T>;

  stream: Stream<T>;
}

Keywords

FAQs

Package last updated on 21 Feb 2017

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