-
-
Save morintd/9b68ac55451696af51da44e2e9dba82a to your computer and use it in GitHub Desktop.
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
import { ReactNode } from "react"; | |
import { DependencyContext } from "../common/dependency-context"; | |
import { InMemoryBoardRepository } from "../tic-tac-toe/adapters/in-memory-board.repository"; | |
type Props = { | |
children: ReactNode; | |
}; | |
const board = new InMemoryBoardRepository(); | |
export function DependencyContextProvider(props: Props) { | |
const { children } = props; | |
return ( | |
<DependencyContext.Provider value={{ board }}> | |
{children} | |
</DependencyContext.Provider> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment