# @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

Latest version **1.0.0** (published 2019-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @most/adapter
pnpm add @most/adapter
yarn add @most/adapter
bun add @most/adapter
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-01-04 |
| First published | 2019-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Brian Cavalier |
| Maintainers | most |

## Links

- npm: https://www.npmjs.com/package/@most/adapter
- npm.io page: https://npm.io/package/@most/adapter

## Dependencies (1)

- [@most/types](https://npm.io/package/@most/types.md) ^1.0.1

## Recent versions

- 1.0.0 (latest) — 2019-01-04

## README

# @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

```js
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 :: () &rarr; Adapter<A>

Create an Adapter.

```js
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
```

---
_Source: https://npm.io/package/@most/adapter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
