# svelte/no-store-async
disallow using async/await inside svelte stores because it causes issues with the auto-unsubscribing features
- âī¸ This rule is included in
"plugin:svelte/recommended"
.
# đ Rule Details
This rule reports all uses of async/await inside svelte stores. Because it causes issues with the auto-unsubscribing features.
/* eslint svelte/no-store-async: "error" */
import { writable, readable, derived } from 'svelte/store';
/* â GOOD */
const w1 = writable(false, () => {});
const r1 = readable(false, () => {});
const d1 = derived(a1, ($a1) => {});
/* â BAD */
const w2 = writable(false, Do not pass async functions to svelte stores. (svelte/no-store-async)async () => {});
const r2 = readable(false, Do not pass async functions to svelte stores. (svelte/no-store-async)async () => {});
const d2 = derived(a1, Do not pass async functions to svelte stores. (svelte/no-store-async)async ($a1) => {});
# đ§ Options
Nothing.
# đ Further Reading
# đ Version
This rule was introduced in eslint-plugin-svelte v2.7.0