This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::num::{One}; | |
trait Observer<A> { | |
fn next(&mut self, val: A); | |
} | |
trait Observable<A> { | |
fn subscribe<'r, N: Observer<A>>(&mut self, observer: N); | |
#[inline] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Observable(subscribe) { | |
this._subscribe = subscribe; | |
} | |
const of = (v) => new Observable(observer => { | |
return observer.next(v); | |
}); | |
Observable.prototype = { | |
map(f) { |