Created
February 5, 2020 17:07
-
-
Save r3dm1ke/c69bd85cbf8f7e893ec37c8d350603c9 to your computer and use it in GitHub Desktop.
RxJS TS readability example
This file contains hidden or 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
| // HACK: Since TypeScript inherits static properties too, we have to | |
| // fight against TypeScript here so Subject can have a different static create signature | |
| /** | |
| * Creates a new cold Observable by calling the Observable constructor | |
| * @static true | |
| * @owner Observable | |
| * @method create | |
| * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor | |
| * @return {Observable} a new cold observable | |
| * @nocollapse | |
| * @deprecated use new Observable() instead | |
| */ | |
| static create: Function = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => { | |
| return new Observable<T>(subscribe); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment