Created
November 13, 2018 13:07
-
-
Save nathan-lapinski/dcab09af1708bb6481bc6614589fa76e to your computer and use it in GitHub Desktop.
obs sub
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
subscribe(observerOrNext?: PartialObserver<T> | ((value: T) => void), | |
error?: (error: any) => void, | |
complete?: () => void): Subscription { | |
const { operator } = this; | |
const sink = toSubscriber(observerOrNext, error, complete); | |
if (operator) { | |
operator.call(sink, this.source); | |
} else { | |
sink.add( | |
this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ? | |
this._subscribe(sink) : | |
this._trySubscribe(sink) | |
); | |
} | |
if (config.useDeprecatedSynchronousErrorHandling) { | |
if (sink.syncErrorThrowable) { | |
sink.syncErrorThrowable = false; | |
if (sink.syncErrorThrown) { | |
throw sink.syncErrorValue; | |
} | |
} | |
} | |
return sink; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment