diff --git a/src/runtime/store/index.ts b/src/runtime/store/index.ts index 1b2481e572..8b89ac27de 100644 --- a/src/runtime/store/index.ts +++ b/src/runtime/store/index.ts @@ -99,11 +99,8 @@ export function writable(value?: T, start: StartStopNotifier = noop): Writ return () => { subscribers.delete(subscriber); if (subscribers.size === 0) { - if (stop === null) { - throw new Error('unsubscribe cannot be called twice'); - } stop(); - stop = null; + stop = noop; } }; }