Skip to content

Instantly share code, notes, and snippets.

@morintd
Created March 11, 2024 19:49
Show Gist options
  • Save morintd/9b68ac55451696af51da44e2e9dba82a to your computer and use it in GitHub Desktop.
Save morintd/9b68ac55451696af51da44e2e9dba82a to your computer and use it in GitHub Desktop.
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