4.1.0 • Published 5 years ago
@most/hold v4.1.0
@most hold()
Deliver the most recently seen event to each new observer the instant it begins observing. A held stream is always multicast.
Note: @most/hold
>= 3.0.0 is compatible with @most/core
. Use @most/hold
2.x for compatibility with most
1.x.
Install
npm install --save @most/hold
Usage
import { click } from '@most/dom-event'
import { map } from '@most/core'
import { hold } from '@most/hold'
const clickCoords = map(e => ({ x: e.clientX, y: clientY }), click(document))
// start holding on first subscription
const heldCoords = hold(clickCoords)
API
hold :: Stream a → Stream a
Given an input stream:
stream: -a---b---c---d->
observers which begin observing at different times will see:
observer1: -a---b---c---d->
observer2: a-b---c---d->
observer3: c--d->
4.1.0
5 years ago
4.0.1
5 years ago
4.0.0
5 years ago
3.0.1
5 years ago
3.0.0
7 years ago
2.0.0
7 years ago
1.4.3
7 years ago
1.4.2
7 years ago
1.4.1
7 years ago
1.4.0
7 years ago
1.3.1
8 years ago
1.3.0
8 years ago
1.2.0
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.0
8 years ago
0.2.0
8 years ago
0.1.1
8 years ago
0.1.0
8 years ago