paldepind / flyd-switchlatest

Flattens a stream of streams. The result stream reflects changes from the last stream only.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flyd-switchlatest

Flattens a stream of streams. The result stream reflects changes from the last stream only.

Signature

Stream (Stream a) -> Stream b

Usage

var chatrooms = flyd.stream();
var messagesStreams = flyd.map(function(id) {
  return createMessageStream(id);
}, chatrooms);
var currentMessages = switchLatest(messagesStreams);

About

Flattens a stream of streams. The result stream reflects changes from the last stream only.

License:MIT License


Languages

Language:JavaScript 100.0%