jotai-devtools
jotai-devtools copied to clipboard
refactor(utils): extract useReduxConnection for less repetition
Chunk of this PR: https://github.com/jotaijs/jotai-devtools/pull/32
This will extract the repeated logic of useAtomDevtools
and useAtomsDevtools
regarding the initial connection to the redux extension into a shared custom hook. It will be helpful to implement consistent behavior for both hooks. 🙂
(for example when https://github.com/reduxjs/redux-devtools/issues/1370 is fixed or #32 is implemented as temporary solution or if there is any other solution for the duplicated connection problem)
This is only a refactoring, it should not introduce any behavioral changes.