hoichi / last

Wait for the last event to play

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

most-last

Wait for your last event to play

Last will wait until your stream ends, and play the very last event that has occurred.

Get it

npm install --save most-last

Usage

import { iterate, take } from 'most'
import { last } from 'most-last'

const stream = last(take(5, iterate(x => x + 1, 0)))

stream.observe(function (x) {
  if (x === 4) { // true
    ...
  }
})

About

Wait for the last event to play

License:MIT License


Languages

Language:JavaScript 100.0%