Skip to content

Commit 45fc9db

Browse files
committed
chore: fix Invalidator type
1 parent 787e091 commit 45fc9db

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/svelte/src/store/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function writable(value, start = noop) {
7474

7575
/**
7676
* @param {Subscriber<T>} run
77-
* @param {Invalidator<T>} [invalidate]
77+
* @param {Invalidator} [invalidate]
7878
* @returns {Unsubscriber}
7979
*/
8080
function subscribe(run, invalidate = noop) {

packages/svelte/src/store/private.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Readable, Subscriber } from './public.js';
22

33
/** Cleanup logic callback. */
4-
type Invalidator<T> = (value?: T) => void;
4+
type Invalidator = () => void;
55

66
/** Pair of subscriber and invalidator. */
7-
type SubscribeInvalidateTuple<T> = [Subscriber<T>, Invalidator<T>];
7+
type SubscribeInvalidateTuple<T> = [Subscriber<T>, Invalidator];
88

99
/** One or more `Readable`s. */
1010
type Stores = Readable<any> | [Readable<any>, ...Array<Readable<any>>] | Array<Readable<any>>;

packages/svelte/src/store/public.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface Readable<T> {
3030
* @param run subscription callback
3131
* @param invalidate cleanup callback
3232
*/
33-
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
33+
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator): Unsubscriber;
3434
}
3535

3636
/** Writable interface for both updating and subscribing. */

0 commit comments

Comments
 (0)