1
Fork 0
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:
Steffo 2023-08-22 05:08:43 +02:00
parent b3ce2e9f0b
commit d4ac9b9cbd
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -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}
}