Skip to content

Commit

Permalink
[FE] Feat #133: 댓글 text에 해당하는 전역 state 추가
Browse files Browse the repository at this point in the history
Change-Id: Idd1f8130288230a570eb1afc86b75db97e3f5673
  • Loading branch information
leewooseong committed Feb 7, 2024
1 parent b40f01f commit e26d01c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions frontend/src/store/detailStore.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { create } from 'zustand'
import { devtools } from 'zustand/middleware'

interface ICommentStore {
commentText: string
setCommentText: (commentText: string) => void
resetCommentText: () => void
}

export const useCommentStore = create<ICommentStore>()(
devtools((set) => ({
commentText: '',
setCommentText: (commentText: string) => set(() => ({ commentText: commentText })),
resetCommentText: () => set(() => ({ commentText: '' })),
}))
)

0 comments on commit e26d01c

Please sign in to comment.