-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from 9oormDari/dev
Dev
- Loading branch information
Showing
5 changed files
with
136 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// idStore.ts | ||
import { create } from 'zustand'; | ||
|
||
// μν νμ μ μ μν©λλ€. | ||
interface IdState { | ||
id: string; | ||
} | ||
|
||
// μ‘μ νμ μ μ μν©λλ€. | ||
interface IdActions { | ||
setId: (newId: string) => void; | ||
} | ||
|
||
// μνμ μ‘μ μ ν©μΉ νμ μ μ μν©λλ€. | ||
type IdStore = IdState & IdActions; | ||
|
||
// μνλ₯Ό κ΄λ¦¬νλ zustand μ€ν μ΄λ₯Ό μμ±ν©λλ€. | ||
const useIdStore = create<IdStore>((set) => ({ | ||
id: '', // μ΄κΈ° μν κ° | ||
|
||
// setId ν¨μλ μλ‘μ΄ id κ°μ λ°μμ μνλ₯Ό μ λ°μ΄νΈν©λλ€. | ||
setId: (newId) => set(() => ({ id: newId })), | ||
})); | ||
|
||
export default useIdStore; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters