set writable value to optional

pull/6293/head
Ignatius Bagus 5 years ago
parent 086cff2272
commit d244540384
No known key found for this signature in database
GPG Key ID: 357C6674A45CC06B

@ -61,7 +61,7 @@ export function readable<T>(value: T, start: StartStopNotifier<T>): Readable<T>
* @param {*=}value initial value
* @param {StartStopNotifier=}start start and stop notifications for subscriptions
*/
export function writable<T>(value: T, start: StartStopNotifier<T> = noop): Writable<T> {
export function writable<T>(value?: T, start: StartStopNotifier<T> = noop): Writable<T> {
let stop: Unsubscriber;
const subscribers: Array<SubscribeInvalidateTuple<T>> = [];

Loading…
Cancel
Save