使用 Svelte stores 进行全局状态管理: typescript import { writable } from 'svelte/store'; export const myStore = writable(initialValue);
- 在组件中使用
$前缀访问 store 的值: svelte
- 在组件中使用
响应性
对派生值使用响应式声明: svelte $: derivedValue = someValue * 2;
对副作用使用响应式语句: svelte $: { console.log(someValue); updateSomething(someValue); }
Sveltekit Tailwind Typescript Guide Svelte State Management
Use when working with SvelteKit — state management, stores, reactive declarations
Sveltekit Tailwind Typescript Guide Svelte State Management by liaosw97 · f429ade
npx skillmds@latest add liaosw97/sveltekit-tailwind-typescript-guide-svelte-state-management File contents
---name: sveltekit-tailwind-typescript-guide-svelte-state-managementdescription: Use when working with SvelteKit — state management, stores, reactive declarations---- 使用 Svelte stores 进行全局状态管理: typescript import { writable } from 'svelte/store'; export const myStore = writable(initialValue); - 在组件中使用 `$` 前缀访问 store 的值: svelte <p>{$myStore}</p> - 响应性 - 对派生值使用响应式声明: svelte $: derivedValue = someValue * 2; - 对副作用使用响应式语句: svelte $: { console.log(someValue); updateSomething(someValue); }
liaosw97/awesome-rules-skills/tree/main/plugins/sveltekit-tailwind/skills/sveltekit-tailwind-typescript-guide-svelte-state-management commit f429adef6d
Frequently asked questions
Run npx skillmds@latest add liaosw97/sveltekit-tailwind-typescript-guide-svelte-state-management in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Use when working with SvelteKit — state management, stores, reactive declarations It is listed under Web & Frontend on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
liaosw97 (@liaosw97) published this skill. Their other Agent Skills are listed on their SkillMD profile.