-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: CategoryContext를 Action과 Value Context로 분리
- Loading branch information
Showing
10 changed files
with
57 additions
and
32 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
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,14 @@ | ||
import { useContext } from 'react'; | ||
|
||
import { CategoryActionContext } from '@/contexts/CategoryContext'; | ||
|
||
const useCategoryActionContext = () => { | ||
const categoryAction = useContext(CategoryActionContext); | ||
if (categoryAction === null || categoryAction === undefined) { | ||
throw new Error('useCategoryActionContext는 Category Provider 안에서 사용해야 합니다.'); | ||
} | ||
|
||
return categoryAction; | ||
}; | ||
|
||
export default useCategoryActionContext; |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
import { useContext } from 'react'; | ||
|
||
import { CategoryValueContext } from '@/contexts/CategoryContext'; | ||
|
||
const useCategoryValueContext = () => { | ||
const categoryValue = useContext(CategoryValueContext); | ||
if (categoryValue === null || categoryValue === undefined) { | ||
throw new Error('useCategoryValueContext는 Category Provider 안에서 사용해야 합니다.'); | ||
} | ||
|
||
return categoryValue; | ||
}; | ||
|
||
export default useCategoryValueContext; |
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