What is the best approach to handle dependant updates in a normalized state shaped store? #3245
Unanswered
Sivanesh-S
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm new to the redux toolkit. Where I created a store with the normalized state shape like https://redux.js.org/usage/structuring-reducers/normalizing-state-shape
In such cases how to perform an action that happens synchronously?
For example, In this case, (
blogPostsobject in the link above) I have 2 slices using createSliceblogscommentsIf I trigger an action
deleteBlog('blogId1')blogsslicecommentsslice.So how to achieve this?
I have a few solutions.
commentIdson the action creator itself increateActionand dispatch it.createAsyncThunklike this and dispatch the action from the component.But I don't know whether that is the correct flow to write. or are there any other solutions recommended?
Beta Was this translation helpful? Give feedback.
All reactions