({ children })
| 119 | } |
| 120 | |
| 121 | export const LoadingProvider = ({ children }) => { |
| 122 | const [state, dispatch] = useReducer(reducer, { |
| 123 | loading: new Set(), |
| 124 | metadata: new Set(), |
| 125 | chunk: new Set(), |
| 126 | }) |
| 127 | |
| 128 | return ( |
| 129 | <LoadingContext.Provider |
| 130 | value={{ |
| 131 | ...state, |
| 132 | dispatch, |
| 133 | }} |
| 134 | > |
| 135 | {children} |
| 136 | </LoadingContext.Provider> |
| 137 | ) |
| 138 | } |
| 139 | |
| 140 | export const useLoadingContext = () => { |
| 141 | const { loading, metadata, chunk } = useContext(LoadingContext) |
nothing calls this directly
no outgoing calls
no test coverage detected