Skip to content

Instantly share code, notes, and snippets.

@mattpodwysocki
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattpodwysocki/3c8d8221b429afeaa9cc to your computer and use it in GitHub Desktop.
Save mattpodwysocki/3c8d8221b429afeaa9cc to your computer and use it in GitHub Desktop.
Observable.prototype.assign = function (object, property) {
return this.subscribe(function (x) {
object[property] = value;
});
};
// Usage
Observable.range(1, 1000)
.assign(document.querySelector('#result'), 'textContent');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment