- Notifications
You must be signed in to change notification settings - Fork10
📟 Port for Redux Dev Tools Extension now using Context API
NotificationsYou must be signed in to change notification settings
vip-git/context-api-dev-tools-extension
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Port forRedux Dev Tools Extension now usingContext API
npm install --save-dev-exact context-api-dev-tools-extensionDetailed example can beseen here
// Libraryimport useContextDevTools from 'context-api-dev-tools-extension';export function TodosContextProvider({ children}: { children: React.ReactNode;}) { // Define reducer const [todos, dispatch] = useReducer(todosReducer, initialState); // Initialize DevTools Extension const devTools = useContextDevTools(dispatch); // Update devtools to send updated state useEffect(() => { devTools.sendUpdatedState(todos); }, [todos, devTools]); // Mount provider with state context return ( <TodosDispatchContext.Provider value={devTools.sendDispatch}> <TodosStateContext.Provider value={todos}> {children} </TodosStateContext.Provider> </TodosDispatchContext.Provider> );}About
📟 Port for Redux Dev Tools Extension now using Context API
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.
