Skip to content

Commit

Permalink
chore: add this: void typing to store functions (#6094)
Browse files Browse the repository at this point in the history
This is necessary so ESLint does not complain about possibly unbound method access
fixes sveltejs/eslint-plugin-svelte3#102
  • Loading branch information
JounQin committed Mar 24, 2021
1 parent 42a9431 commit 50dcc2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface Readable<T> {
* @param run subscription callback
* @param invalidate cleanup callback
*/
subscribe(run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
}

/** Writable interface for both updating and subscribing. */
Expand All @@ -31,13 +31,13 @@ export interface Writable<T> extends Readable<T> {
* Set value and inform subscribers.
* @param value to set
*/
set(value: T): void;
set(this: void, value: T): void;

/**
* Update value using callback and inform subscribers.
* @param updater callback
*/
update(updater: Updater<T>): void;
update(this: void, updater: Updater<T>): void;
}

/** Pair of subscriber and invalidator. */
Expand Down

0 comments on commit 50dcc2a

Please sign in to comment.