diff --git a/site/content/docs/03-run-time.md b/site/content/docs/03-run-time.md index 7fbc8850de86..537c1aa7ece8 100644 --- a/site/content/docs/03-run-time.md +++ b/site/content/docs/03-run-time.md @@ -245,10 +245,10 @@ This makes it possible to wrap almost any other reactive state handling library #### `writable` ```js -store = writable(value: any) +store = writable(value?: any) ``` ```js -store = writable(value: any, (set: (value: any) => void) => () => void) +store = writable(value?: any, start?: (set: (value: any) => void) => () => void) ``` --- diff --git a/src/runtime/store/index.ts b/src/runtime/store/index.ts index cf15db5250b9..985f8c792d4b 100644 --- a/src/runtime/store/index.ts +++ b/src/runtime/store/index.ts @@ -61,7 +61,7 @@ export function readable(value: T, start: StartStopNotifier): Readable * @param {*=}value initial value * @param {StartStopNotifier=}start start and stop notifications for subscriptions */ -export function writable(value: T, start: StartStopNotifier = noop): Writable { +export function writable(value?: T, start: StartStopNotifier = noop): Writable { let stop: Unsubscriber; const subscribers: Array> = [];