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, (
blogPosts
object in the link above) I have 2 slices using createSliceblogs
comments
If I trigger an action
deleteBlog('blogId1')
blogs
slicecomments
slice.So how to achieve this?
I have a few solutions.
commentIds
on the action creator itself increateAction
and dispatch it.createAsyncThunk
like 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