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

flyd-scanmerge

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flyd-scanmerge

Flyd module for conveniently merging and scanning several streams into one.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

flyd-scanmerge

Flyd module for conveniently merging and scanning several streams into one.

Signature

[[Stream b, (a, b -> a)]] -> a -> Stream a

Example

var add = flyd.stream(0);
var sub = flyd.stream(0);
var mult = flyd.stream(1);
var res = scanMerge([
  [add, function(sum, n) { return sum + n; }],
  [sub, function(sum, n) { return sum - n; }],
  [mult, function(sum, n) { return sum * n; }],
], 0);
add(5); sub(8); sub(4); add(12); mult(3);
console.log(res); // logs 15
var addItem = flyd.stream();
var rmItem = flyd.stream();
var items = scanMerge([
  [addItem, function(list, item) { return list.concat([item]); }],
  [rmItem, function(list, item) {
    return list.filter(function(elm) { return elm !== item; });
  }]
], []);
addItem(1)(2)(3)(4)(5);
rmItem(3);
console.log(items()); logs [1, 2, 4, 5]

Keywords

FAQs

Package last updated on 30 Apr 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