Skip to content

Instantly share code, notes, and snippets.

@morintd
Created March 11, 2024 19:48
Show Gist options
  • Save morintd/f122aa04027190182e53a05b9fc70158 to your computer and use it in GitHub Desktop.
Save morintd/f122aa04027190182e53a05b9fc70158 to your computer and use it in GitHub Desktop.
import { createContext, useContext } from "react";
import { type IBoardRepository } from "../tic-tac-toe/ports/board-repository.port";
type ContextType = {
board: IBoardRepository;
};
export const DependencyContext = createContext<ContextType>({} as ContextType);
export const useDependencyContext = () => useContext(DependencyContext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment