Socket
Socket
Sign inDemoInstall

prescription

Package Overview
Dependencies
3
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    prescription

A functional reactive programming framework


Version published
Weekly downloads
13
increased by1200%
Maintainers
1
Install size
323 kB
Created
Weekly downloads
 

Readme

Source

Prescription

Build Status Coverage Status Dependencies

browser support

Functional reactive programming in javascript. You can kind of think of it as streams with super powers. It's a paradigm that encourages the developer to structure everything as a stream. Once everything is a stream, you get a level of composition that would be otherwise troublesome to get correct in a simple way.

Example

var Observable = require("prescription").Observable;

// Create an Observable (read stream)
var observable = new Observable();

// This function applies a bunch of Transformers to the supplied
// Observable and returns a new Observable
var queryStream = function(observable) {
    return observable.where(function(item) { return item % 2 == 0; })
                     .skip(30)
                     .take(15)
                     .map(function(item) { return item * 2; })
                     .throttle(300);
};

// Apply the function to our Observable and subscribe to the new Observable
queryStream(observable).subscribe(function(data) { console.log(data); });

// Write some data to the Observable
for (var i = 0; i < 100; i++) {
    observable.write(i);
}

Keywords

FAQs

Last updated on 11 Jun 2013

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc