({ children })
| 4 | const GithubContext = createContext() |
| 5 | |
| 6 | export const GithubProvider = ({ children }) => { |
| 7 | const initialState = { |
| 8 | users: [], |
| 9 | user: {}, |
| 10 | repos: [], |
| 11 | loading: false, |
| 12 | } |
| 13 | |
| 14 | const [state, dispatch] = useReducer(githubReducer, initialState) |
| 15 | |
| 16 | return ( |
| 17 | <GithubContext.Provider |
| 18 | value={{ |
| 19 | ...state, |
| 20 | dispatch, |
| 21 | }} |
| 22 | > |
| 23 | {children} |
| 24 | </GithubContext.Provider> |
| 25 | ) |
| 26 | } |
| 27 | |
| 28 | export default GithubContext |
nothing calls this directly
no outgoing calls
no test coverage detected