diff --git a/store.js b/store.js index ae2955a258..ffef5c7ca8 100644 --- a/store.js +++ b/store.js @@ -24,7 +24,7 @@ export function readable(start, value) { if (index !== -1) subscribers.splice(index, 1); if (subscribers.length === 0) { - stop(); + stop && stop(); stop = null; } }; @@ -85,4 +85,4 @@ export function derive(stores, fn) { run_all(unsubscribers); }; }); -} \ No newline at end of file +}