Skip to content

Instantly share code, notes, and snippets.

@fponticelli
fponticelli / stream.js
Created April 21, 2014 15:50
simple stream
import Timer from 'ui/timer';
let _listeners = Symbol();
class Source {
constructor(callback) {
this[_listeners] = [];
let sink = (value) => {
Timer.immediate(() => {
this[_listeners].map(ƒ => ƒ(value));