Not sure what you mean by "boilerplate for thunks". You write thunks the same way you always have.
And yes, `createSlice` explicitly supports responding to actions that were defined elsewhere in the app, using the `extraReducers` argument:
https://redux-toolkit.js.org/api/createSlice#extrareducers
Although... are you saying that you want one reducer function to handle many different actions in one slice? Just define the reducer outside the slice itself, and pass it as the handler for each action:
createSlice({
name: "someSlice",
initialState,
reducers: {
action1: someCaseReducer,
action2: someCaseReducer,
}
})
Did something similar in my own app recently at work, where multiple slices all needed to handle loading data similarly. So, I wrote a couple generic reducers, and passed them in to each of the slices.