mirror of
https://github.com/Steffo99/todocolors.git
synced 2024-11-22 00:04:18 +00:00
Use DEFAULT_BOARD_STATE
in useBoardState
This commit is contained in:
parent
b3ce2e9f0b
commit
d4ac9b9cbd
1 changed files with 2 additions and 1 deletions
|
@ -3,10 +3,11 @@
|
|||
import {BoardSignal} from "@/app/[lang]/board/[board]/(api)/(signal)"
|
||||
import {boardReducer} from "@/app/[lang]/board/[board]/(api)/(state)/boardReducer"
|
||||
import {BoardState} from "@/app/[lang]/board/[board]/(api)/(state)/BoardState"
|
||||
import {DEFAULT_BOARD_STATE} from "@/app/[lang]/board/[board]/(api)/(state)/defaultBoardState"
|
||||
import {Reducer, useReducer} from "react"
|
||||
|
||||
export function useBoardState() {
|
||||
const [boardState, processBoardSignal] = useReducer<Reducer<BoardState, BoardSignal | null>>(boardReducer, {title: "", tasksById: {}})
|
||||
const [boardState, processBoardSignal] = useReducer<Reducer<BoardState, BoardSignal | null>>(boardReducer, DEFAULT_BOARD_STATE)
|
||||
|
||||
return {boardState, processBoardSignal}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue