0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

chore: add this: void typing to store functions (#6094)

This is necessary so ESLint does not complain about possibly unbound method access
fixes https://github.com/sveltejs/eslint-plugin-svelte3/issues/102
This commit is contained in:
JounQin 2021-03-24 22:43:12 +08:00 committed by GitHub
parent 42a9431e70
commit 50dcc2aaa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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. */
@ -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. */