From 0d31e5c046106b4ee7c2c699b9d04c71bb75611a Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Tue, 4 Jun 2019 22:15:58 -0400 Subject: [PATCH] fix typo --- src/runtime/store/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/runtime/store/index.ts b/src/runtime/store/index.ts index 6f14162115ac..5ab6cfa26b58 100644 --- a/src/runtime/store/index.ts +++ b/src/runtime/store/index.ts @@ -10,7 +10,7 @@ type Unsubscriber = () => void; type Updater = (value: T) => T; /** Cleanup logic callback. */ -type Invalidater = (value?: T) => void; +type Invalidator = (value?: T) => void; /** Start and stop notification callbacks. */ type StartStopNotifier = (set: Subscriber) => Unsubscriber | void; @@ -22,7 +22,7 @@ export interface Readable { * @param run subscription callback * @param invalidate cleanup callback */ - subscribe(run: Subscriber, invalidate?: Invalidater): Unsubscriber; + subscribe(run: Subscriber, invalidate?: Invalidator): Unsubscriber; } /** Writable interface for both updating and subscribing. */ @@ -41,7 +41,7 @@ export interface Writable extends Readable { } /** Pair of subscriber and invalidator. */ -type SubscribeInvalidateTuple = [Subscriber, Invalidater]; +type SubscribeInvalidateTuple = [Subscriber, Invalidator]; /** * Creates a `Readable` store that allows reading by subscription. @@ -78,7 +78,7 @@ export function writable(value: T, start: StartStopNotifier = noop): Writa set(fn(value)); } - function subscribe(run: Subscriber, invalidate: Invalidater = noop): Unsubscriber { + function subscribe(run: Subscriber, invalidate: Invalidator = noop): Unsubscriber { const subscriber: SubscribeInvalidateTuple = [run, invalidate]; subscribers.push(subscriber); if (subscribers.length === 1) { @@ -127,7 +127,7 @@ export function derived( const auto = fn.length < 2; - const invalidators: Array> = []; + const invalidators: Array> = []; const store = readable(initial_value, (set) => { let inited = false; @@ -173,7 +173,7 @@ export function derived( }); return { - subscribe(run: Subscriber, invalidate: Invalidater = noop): Unsubscriber { + subscribe(run: Subscriber, invalidate: Invalidator = noop): Unsubscriber { invalidators.push(invalidate); const unsubscribe = store.subscribe(run, invalidate);