Created
August 2, 2015 16:19
-
-
Save mrspeaker/6aec4434c486a000a464 to your computer and use it in GitHub Desktop.
Plain functions as RxJS Subjects
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
import Rx from 'rx'; | |
const RxFuncSubject = () => { | |
const subject = Object.assign( | |
(...args) => subject.onNext(...args), | |
Rx.Observable.prototype, | |
Rx.Subject.prototype); | |
Rx.Subject.call(subject); | |
return subject; | |
}; | |
export default RxFuncSubject; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment