From 44b61b123517b7a0d0e037633f1f2b42fdda90f7 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Wed, 12 Dec 2018 19:52:39 -0500 Subject: [PATCH] Update store.js Co-Authored-By: Rich-Harris --- store.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +}