Socket
Socket
Sign inDemoInstall

dstream

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dstream

Downstream


Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

downstream

Downstream is a reactive programming library for JavaScript.

Its purpose is to be easy to understand, easy to extend, and easy to debug.

Getting started

Installation (browser)

git clone https://github.com/anttisykari/dstream

<script src='dstream.js'></script>

Installation (node.js)

npm install dstream

var stream = require('dstream');

First steps

// Create a source stream
var s = stream();

// You can observe stream's values
s.forEach(function(value) {
    console.log('I got a value', value);
});

// You can set its value
s.set(1);
// -> I got a value 1

// You can create a derived stream
var s2 = stream.map(function(value) {
    return value * 2;
});

s2.forEach(function(value) {
    console.log('s2', value);
});

s.set(123):
// -> s2 246

Anatomy of a stream

Stream's properties

  • value
  • children
  • parents
  • update (source stream)

Source streams

Derived streams

Using streams

...

Keywords

FAQs

Package last updated on 28 Jan 2015

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