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

@most/adapter

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

@most/adapter

Mostjs emphasizes declarative event streams, which have many advantages, such as helping to avoid race conditions. However, getting data into a mostjs event stream graph from 3rd party libraries that weren't designed with that approach in mind can be tri

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
6.5K
decreased by-22.23%
Maintainers
1
Weekly downloads
 
Created
Source

@most/adapter

Mostjs emphasizes declarative event streams, which have many advantages, such as helping to avoid race conditions. However, getting data into a mostjs event stream graph from 3rd party libraries that weren't designed with that approach in mind can be tricky. Often, trying to force a library into that model leads to a messy solution.

Most-adapter provides a disciplined imperative API for getting external data into a mostjs stream, with the goal of making it simpler to integrate libraries that don't lend themselves to a declarative approach.

API

Adapter

type Adapter<A, B = A> = [(event: A) => void, Stream<B>]

An adapter is an entangled pair of an event stream, and a function to induce (cause) events in that stream.

createAdapter :: () → Adapter

Create an Adapter.

const [induce, events] = createAdapter<string>()

induce('hello') // cause an event with value "hello" to occur in events
induce('world') // cause an event with value "world" to occur in events

FAQs

Package last updated on 04 Jan 2019

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