Replies: 1 comment
-
Yes, any kind of AJAX request is absolutely a side effect, and you must not do that in a reducer. I'd recommend reading through these tutorial pages to better understand how to do async logic in a Redux app: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone.
I have a couple of reducer functions inside my
checkoutSlice.js
file.Specifically inside
fetchCheckout
function I'm trying to fetch data (it's successfully fetching)and store it in the state as
checkout
.But for some reason it gives me this mistake:
TypeError: Cannot perform 'get' on a proxy that has been revoked
on this line:
.catch((err) => console.log(err));
I kinda see the mistake here, I'm probably violating some of these rules:
But I don't know how to implement better decisions here.
Previously I was using Context API for state management and it worked well. Now I want to keep the same logic and keep fetching functions and the state at the same globally accessible place.
Any suggestions, recommendations on how to do it a better way?
Thank you in advance
Beta Was this translation helpful? Give feedback.
All reactions