diff --git a/package.json b/package.json index 7a1ff21..8a3d3a0 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "@typescript-eslint/parser": "^8.38.0", "react": "^19.1.0", "react-dom": "^19.1.0", - "tailwindcss": "^4.1.11" + "tailwindcss": "^4.1.11", + "zustand": "^5.0.7" }, "devDependencies": { "@eslint/js": "^9.30.1", diff --git a/src/store.ts b/src/store.ts new file mode 100644 index 0000000..9eb8f12 --- /dev/null +++ b/src/store.ts @@ -0,0 +1,7 @@ +import { create } from 'zustand'; +import type { Store } from './types'; + +export const useStore = create((set) => ({ + data: '', + setData: (newData) => set({ data: newData }), +})); diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..5052653 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,4 @@ +export interface Store { + data: string; + setData: (newData: string) => void; +} diff --git a/yarn.lock b/yarn.lock index 5f0e165..83af753 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4652,3 +4652,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zustand@^5.0.7: + version "5.0.7" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-5.0.7.tgz#e325364e82c992a84bf386d8445aa7f180c450dc" + integrity sha512-Ot6uqHDW/O2VdYsKLLU8GQu8sCOM1LcoE8RwvLv9uuRT9s6SOHCKs0ZEOhxg+I1Ld+A1Q5lwx+UlKXXUoCZITg==