Skip to content

Instantly share code, notes, and snippets.

@xgrommx
Forked from getify/plugin.toObservable.js
Last active August 29, 2015 14:25
Show Gist options
  • Save xgrommx/cf07e34e547fcca5b04c to your computer and use it in GitHub Desktop.
Save xgrommx/cf07e34e547fcca5b04c to your computer and use it in GitHub Desktop.
adapting an ASQ instance to an observable
ASQ.extend("toObservable",function __build__(api,internals){
return function __toObsv__() {
return Rx.Observable.create(function(observer) {
api.val(function(msg){
observer.onNext(msg);
return ASQ.messages.apply(ø,arguments);
});
});
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment