pinterest-for-woocommerce
pinterest-for-woocommerce copied to clipboard
Refactor common custom hooks so there is a single implementation of each
For example, there are two implementations of useCreateNotice
:

Custom hooks like this should be decoupled from the components that use them, and should have a clearly defined interface. In general it's a good idea to implement custom hooks in a single lib folder, e.g. at top of assets/source/custom-hooks
.
If different client components need different behaviour from the hooks, this should be implemented via arguments or separate hooks. Having multiple copies of similar custom hooks could easily lead to bugs in future and will be more complex to maintain.