Update src/runtime/store/index.ts

pull/8368/head
Simon H 4 years ago committed by GitHub
parent cb6624f6e2
commit a83c336ffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -203,6 +203,9 @@ export function derived<T>(stores: Stores, fn: Function, initial_value?: T): Rea
return function stop() { return function stop() {
run_all(unsubscribers); run_all(unsubscribers);
cleanup(); cleanup();
// We need to set this to false because callbacks can still happen despite having unsubscribed:
// Callbacks might already be placed in the queue which doesn't know it should no longer
// invoke this derived store.
started = false; started = false;
}; };
}); });

Loading…
Cancel
Save