본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)48k · #6244

zustand-store-ts

하는 일

이 코드는 Zustand 라이브러리를 사용해 웹 애플리케이션의 데이터 ‘스토어’를 만드는 데 도움을 줍니다. 데이터가 어떻게 보관되고 접근·수정되는지 정리하며, TypeScript와 함께 올바르게 작동하도록 합니다.

사용하는 경우

  • ✓앱의 여러 부분에서 함께 쓰는 정보를 저장해야 할 때.
  • ✓프로젝트의 상태 관리 체계를 만들 때.
  • ✓시간이 지나며 바뀌는 전역 데이터를 정리하고 싶은 경우.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/zustand-store-ts/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/zustand-store-ts/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“장바구니의 상태를 관리하는 스토어를 만들어 주세요. 상품 목록과 합계를 포함하고, 상품을 추가하고 제거하는 함수가 있어야 합니다.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

데이터를 정의하는 방식(상태)과 그 데이터로 할 일(동작)을 정하는 패턴을 사용합니다. 또한 데이터가 바뀔 때 앱의 필요한 부분만 업데이트되도록 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Zustand Store

Create Zustand stores following established patterns with proper TypeScript types and middleware.

Quick Start

Copy the template from assets/template.ts and replace placeholders:

  • {{StoreName}} → PascalCase store name (e.g., Project)
  • {{description}} → Brief description for JSDoc

Always Use subscribeWithSelector

import { create } from 'zustand';
import { subscribeWithSelector } from 'zustand/middleware';

export const useMyStore = create<MyStore>()(
  subscribeWithSelector((set, get) => ({
    // state and actions
  }))
);

Separate State and Actions

export interface MyState {
  items: Item[];
  isLoading: boolean;
}

export interface MyActions {
  addItem: (item: Item) => void;
  loadItems: () => Promise<void>;
}

export type MyStore = MyState & MyActions;

Use Individual Selectors

// Good - only re-renders when `items` changes
const items = useMyStore((state) => state.items);

// Avoid - re-renders on any state change
const { items, isLoading } = useMyStore();

Subscribe Outside React

useMyStore.subscribe(
  (state) => state.selectedId,
  (selectedId) => console.log('Selected:', selectedId)
);

Integration Steps

  1. Create store in src/frontend/src/store/
  2. Export from src/frontend/src/store/index.ts
  3. Add tests in src/frontend/src/store/*.test.ts

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
자주 묻는 질문

‘Zustand’란 무엇인가요?

웹 애플리케이션에서 데이터를 더 쉽게 관리하도록 돕는 라이브러리입니다.

‘TypeScript’란 무엇인가요?

코드에서 오류를 막도록 추가 검사를 해 주는 프로그래밍 언어입니다.

‘미들웨어’란 무엇인가요?

스토어에 ‘플러그인’처럼 추가 기능을 더하는 것입니다. 예를 들어 변경 사항을 기록하거나 비동기 동작을 처리합니다.

상세 정보

작성자의 원본 설명

Create Zustand stores following established patterns with proper TypeScript types and middleware.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#6244
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬