--- title: Quick Start id: quick-start --- The basic Svelte app example to get started with the TanStack svelte-store. **store.ts** ```ts import { createStore } from '@tanstack/svelte-store'; // You can instantiate the store outside of Svelte files too! export const store = createStore({ dogs: 0, cats: 0, }); export function updateState(animal: 'cats' | 'dogs') { store.setState((state) => { return { ...state, [animal]: state[animal] + 1, }; }); } ``` **App.svelte** ```html
Press one of the buttons to add a counter of how many of your friends like cats or dogs