Skip to content

Commit

Permalink
Implement a fix for the "ERROR Error: Observable cancelled prematurel…
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewrc committed Aug 2, 2021
1 parent b4b859b commit 66ff30c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utilities/observables/Concast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class Concast<T> extends Observable<T> {
// Delay unsubscribing from the underlying subscription slightly,
// so that immediately subscribing another observer can keep the
// subscription active.
if (sub) Promise.resolve().then(() => sub.unsubscribe());
if (sub) setTimeout(()=>{sub.unsubscribe()}, 0)
this.sub = null;
this.latest = ["error", error];
this.reject(error);
Expand Down

0 comments on commit 66ff30c

Please sign in to comment.