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

flyd-droprepeats

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flyd-droprepeats

Drop repeated values with Flyd

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

flyd-droprepeats

Drops consecutively repeated values from a Flyd stream.

API

dropRepeats(s)

Drops repeated values from stream s. Equality is determined by reference.

Signature

Stream a -> Stream a

Usage

var dropRepeats = require('flyd-droprepeats').dropRepeats;
var append = function(arr, x) {
  return arr.concat(x);
};

var s = flyd.stream();
var noRepeats = dropRepeats(s);
var collect = flyd.scan(append, [], noRepeats);
s(1)(2)(2)(3);
collect() // [1, 2, 3]

dropRepeatsWith(fn, s)

Drops repeated values from stream s, but also takes a function fn that will be used to determine equality.

Signature

(a -> b -> Boolean) -> Stream a -> Stream a

var dropRepeatsWith = require('flyd-droprepeats').dropRepeatsWith;
var s = flyd.stream();
// Ramda's `equals` determines equality by value
var noRepeats = dropRepeatsWith(R.equals, s);
var collect = flyd.scan(append, [], noRepeats);
s({ foo: 'bar' });
s({ foo: 'bar' });
collect() // [{ foo: 'bar' }]

FAQs

Package last updated on 07 Mar 2016

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