Skip to content

Instantly share code, notes, and snippets.

@GarryBrown
Created June 18, 2020 08:27
Show Gist options
  • Save GarryBrown/2fcde904105493f67788d48772ff3aeb to your computer and use it in GitHub Desktop.
Save GarryBrown/2fcde904105493f67788d48772ff3aeb to your computer and use it in GitHub Desktop.
protected destination: Observer<any> | Subscriber<any>;
constructor(destinationOrNext?: PartialObserver<any> | ((value: T) => void) | null,
error?: ((e?: any) => void) | null,
complete?: (() => void) | null) {
super();
switch (arguments.length) {
case A:
this.destination = emptyObserver;
case B:
this.destination = destinationOrNext;
case C:
this.destination = new SafeSubscriber<T>(this, <((value: T) => void)> destinationOrNext, error, complete);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment