From 5ecb9c98fa7b6a8a0df75f828cfc993ca98a108c Mon Sep 17 00:00:00 2001 From: xeoxxn Date: Wed, 13 Aug 2025 22:12:36 +0900 Subject: [PATCH] =?UTF-8?q?init:=20zustand=20=EC=B4=88=EA=B8=B0=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- src/store.ts | 7 +++++++ src/types.ts | 4 ++++ yarn.lock | 5 +++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/store.ts create mode 100644 src/types.ts 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==