You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.
to achieve something like this redux documentation recommend using normalizr i think this can help to this redux architecture to be better.
another personal question that i have is when we call an API that by default have a filter system and pagination and we want to show the most rating shows and the most popular shows, putting your action request show like example we can change like this
but we have a problem if we want to store the popular and the most rating shows if we call the tow dispatch we rewrite the state and we only have the first action dispatched
I found a solution to make two action functions and then in the reducer when these actions finished store the state in the different arrays, like this:
in the documentation of redux, the say normalize the state is better than have a nested state
this is an example of one state normalized from documentation of redux
Your showRrducer can change the state and have a normalized state like this
Before
After
The redux documentation says this is better for search an element in the array on the state like this
to achieve something like this redux documentation recommend using normalizr i think this can help to this redux architecture to be better.
another personal question that i have is when we call an API that by default have a filter system and pagination and we want to show the most rating shows and the most popular shows, putting your action request show like example we can change like this
And when we run another time dispatch we pass the arguments like this
but we have a problem if we want to store the popular and the most rating shows if we call the tow dispatch we rewrite the state and we only have the first action dispatched
I found a solution to make two action functions and then in the reducer when these actions finished store the state in the different arrays, like this:
but I think this is not the best way to do this so what other implementation of this can be done ?
The text was updated successfully, but these errors were encountered: