Skip to content

Instantly share code, notes, and snippets.

@dan-cooke
Last active May 23, 2017 09:50
Show Gist options
  • Save dan-cooke/6cb68ed80478617ddc21e27f316d95bf to your computer and use it in GitHub Desktop.
Save dan-cooke/6cb68ed80478617ddc21e27f316d95bf to your computer and use it in GitHub Desktop.
JS Bin// source http://jsbin.com/todewiz
"use strict";
var Stream = (function () {
function Stream(val) {
this._source = new Rx.BehaviorSubject(val);
this._obs = this._source.asObservable();
return this._obs;
}
return Stream;
}());
Stream.prototype.next = function (val) {
this._source.next(val);
};
var s = new Stream('test').subscribe(function (val) { return console.log(val); });
s.next("next test");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment