title: How to add cases in ExtraReducer to match the actions created in currentReducer using createSlice() from @reduxjs/toolkit
body: <p>Here below I have mentioned a redux slice. A fetchAllApps thunk function is created with createAsyncThunk for action <code>'allApps/allappsAdded/'</code> which I dynamically got by <code>allAppsAdded.type</code>. When the fetchAllapps is dispatched it generated actions of type <code>'allApps/allappsAdded/pending'</code>, <code>'allApps/allappsAdded/fulfilled'</code>, <code>'allApps/allappsAdded/rejected'</code> which I need to add in extraReducers to handle it by doing hardcode.Is there any way to add these action types like <code>allAppsAdded.type</code> programatically?. so that in future It makes easy for me to change these without redundant..</p>
  <pre><code>import {
    configureStore,
    createAsyncThunk,
    createSlice
  } from &quot;@reduxjs/toolkit&quot;;
  
  const initialState = {
    apps: [],
    categories: [],
    loading: {
      apps: false
    }
  };
  
  const allappsSlice = createSlice({
    name: &quot;allapps&quot;,
    initialState,
    reducers: {
      allappsAdded: (state, action) =&gt; {
        state[&quot;apps&quot;] = action.payload.apps;
        state[&quot;categories&quot;] = action.payload.categories;
      }
    },
    extraReducers: {
      
    }
  });
  
  export default () =&gt;
    configureStore({
      reducer: allappsSlice.reducer
    });
  
  const { allappsAdded } = allappsSlice.actions;
  
  const fetchAllApps = createAsyncThunk(allappsAdded.type, async () =&gt; {
    console.log(&quot;ss&quot;);
    setTimeout(() =&gt; ({ apps: [], categories: [] }), 2000);
  });
  export { allappsAdded, fetchAllApps };
  </code></pre>