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
I'm not sure if this has been asked before but would it be possible to have createSlice reference other maybe an array/collection of other slices.
I'm quite new to redux and have only ready the API docs but it seems to me that slices are a great way to condense all the redux boilerplate and provide a much better way of organising your code.
I was thinking something like this:
You only need to create a root slice which can reference every other slice
constrootSlice=createSlice({references: [slice1,slice2]// Maybe this or something similar})
Then you effectively have name spaces and only need to create one file with all your actions/reducers etc
// slice1.jsconstsliceOne=createSlice({// initialState, reducers etc. references: [slice1a]// Refers to another slice})
So in the end you can have all your redux logic isolated in their own file.
Let me know what you think,
Thanks
The text was updated successfully, but these errors were encountered:
That's an interesting idea, and not one I'd really thought about. I just opened up #91 to discuss desired behavior for createSlice - let's move the discussion over there.
Hi all,
I'm not sure if this has been asked before but would it be possible to have
createSlice
reference other maybe an array/collection of other slices.I'm quite new to redux and have only ready the API docs but it seems to me that slices are a great way to condense all the redux boilerplate and provide a much better way of organising your code.
I was thinking something like this:
So in the end you can have all your redux logic isolated in their own file.
Let me know what you think,
Thanks
The text was updated successfully, but these errors were encountered: