-
Notifications
You must be signed in to change notification settings - Fork 1
[refactor] refetch card data once card is created, deleted, updated #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,6 @@ import { getBoard } from '@/lib/boardService'; | |
| interface dashboardState { | ||
| dashboard: Dashboard | null; | ||
| setDashboard: (dashboard: number | null) => void; | ||
|
|
||
| color: string; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @21ow |
||
| setColor: (newColor: string) => void; | ||
| } | ||
|
|
||
| const useDashboardStore = create( | ||
|
|
@@ -31,8 +28,6 @@ const useDashboardStore = create( | |
| dashboard: { ...response }, | ||
| }); | ||
| }, | ||
| color: 'var(--violet)', | ||
| setColor: (newColor) => set({ color: newColor }), | ||
| }), | ||
| { | ||
| name: 'dashboardStorage', | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { create } from 'zustand'; | ||
|
|
||
| interface TriggerStore { | ||
| trigger: { | ||
| dashboard: boolean; | ||
| card: boolean; | ||
| }; | ||
| updateTrigger: { | ||
| dashboard: () => void; | ||
| card: () => void; | ||
| }; | ||
| } | ||
|
Comment on lines
+3
to
+12
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. μ.. μ΄κ±° 보λκΉ μ΄λ κ²νλκ±°λ³΄λ€ |
||
|
|
||
| const useTriggerStore = create<TriggerStore>((set) => ({ | ||
| trigger: { | ||
| dashboard: false, | ||
| card: false, | ||
| }, | ||
| updateTrigger: { | ||
| dashboard: () => | ||
| set((state) => ({ | ||
| trigger: { ...state.trigger, dashboard: !state.trigger.dashboard }, | ||
| })), | ||
| card: () => | ||
| set((state) => ({ | ||
| trigger: { ...state.trigger, card: !state.trigger.card }, | ||
| })), | ||
| }, | ||
| })); | ||
|
|
||
| export default useTriggerStore; | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μΉ΄λλ μ μκ°μ΄ μλλΌκ³ μ? κ·Έλμ μλ₯Ό μ°μ μ μΌλ‘ κ°μ Έλ€ μΌμ΅λλ€ κ°μ¬λ§