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

flyd-withlatestfrom

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flyd-withlatestfrom

withLatestFrom implementation for flyd streams

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

flyd-withLatestFrom

Build Status

withLatestFrom implementation for flyd streams.

Creates a stream that emits when the source emits, with the latest values from other streams. Only emits if the other streams all have value.

The values are emitted in an array where first value is the source value, followed by the other streams values.

withLatestFrom([...streams], source) -> Stream -> [sourceVal, ...streamsVals]

Usage

  it('Should emit with the values from streams', function() {
    var withLatestFrom$ = withLatestFrom([stream1$, stream2$], source$)
    stream1$(1)
    stream2$(2)
    assert.deepEqual(withLatestFrom$(), undefined)
    source$(3)
    assert.deepEqual(withLatestFrom$(), [3, 1, 2])
  })

  it('Should not emit if all streams have not emitted', function () {
    var withLatestFrom$ = withLatestFrom([stream1$, stream2$], source$)
    stream1$(1)
    assert.deepEqual(withLatestFrom$(), undefined)
    source$(2)
    assert.deepEqual(withLatestFrom$(), undefined)
  })

Keywords

FAQs

Package last updated on 26 Jan 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