Created
July 19, 2025 19:58
-
-
Save kayhadrin/06ed1f26dd0c92fbbf1b1f7a12de4788 to your computer and use it in GitHub Desktop.
Revisions
-
kayhadrin created this gist
Jul 19, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ /* See https://github.com/ReactiveX/rxjs/blob/5.0.2/src/util/subscribeToResult.ts#L70-L77 And also: - https://github.com/ReactiveX/rxjs/blob/5.0.2/src/Observable.ts - https://github.com/ReactiveX/rxjs/blob/5.0.2/src/symbol/observable.ts */ if (result instanceof Observable) { if (result._isScalar) { destination.next((<any>result).value); destination.complete(); return null; } else { return result.subscribe(destination); } } // ... if (result && typeof result[$$observable] === 'function') { const obs = result[$$observable](); if (typeof obs.subscribe !== 'function') { destination.error(new TypeError('Provided object does not correctly implement Symbol.observable')); } else { return obs.subscribe(new InnerSubscriber(outerSubscriber, outerValue, outerIndex)); } }