Closed rajeev-k-tomy closed 2 years ago
hi @rajeev-k-tomy, thank you for your input, but i'm not sure i'm following you regarding first item. do you mean that its not obvious bc of naming or i need to use src/hooks/useAppContext
instead of direct call ofuseContext(AppContext)
?
@odi-um No, the dispatch
variable is confusing. Because we have dispatch
available for CartContext too. Basically, we have two dispatches. So specifying the dispatch
variable either as appDispatch
or cartDispatch
would be much more cleaner naming in my opinion. In that way, it is clear which dispatch
is referring in the code.
thanks for clarification
@rajeev-k-tomy could you check pr #3? have i covered everything ?
dispatch
value ofAppContext
through the custom hooksrc/hooks/useAppContext
. However, usingdispatch
directly is vague and confusing as it clearly does not tell whichdispatch
it is. Maybe usingappDispatch
make much more sense here.useAppContext
=>useStripeAppContext
useCartContext
=>useStripeCartContext
useCheckoutFormContext
=>useStripCheckoutFormContext
place order
method insrc/hooks/useStripePayments.js
is not passing all the dependencies intouseCallback
useEffect
here https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/components/Cards.jsx#L21-#L28