title: redux-toolkit use an actionCreater in the same slice from another thunk reducer
body: <p>I have a redux-thunk reducer generated with <code>createSlice</code> from redux-toolkit called <code>getOne</code>.</p>
  
  <p><code>getOne</code> fetches from an API and dispatches actions for the loading status, (<code>startedLoading</code>, <code>finishedLoading</code>, <code>errorLoading</code>).</p>
  
  <p>I would like to also call another actionCreater created in the same slice called <code>insert</code> with the resulting data. or directly update the state from the <code>getOne</code> reducer.</p>
  
  <pre class="lang-js prettyprint-override"><code>import { createSlice } from "@reduxjs/toolkit"
  import { startedLoading, finishedLoading, errorLoading } from '../slices/loadingSlice'
  const apiEndpoint = "/api/v1"
  const fetchOptions = { headers: { "Content-Type": "application/json" } }
  
  const createModelSlice = function (modelName) {
    return createSlice({
      name: modelName,
      initialState: {byId: {}},
      reducers: {
        insert: (state, action) =&gt; {
          // ...
        },
        getOne: (state, action) =&gt; async (dispatch) =&gt; {
          // ...
          try {
            const response = await fetch(/*  */)
  
            // How would I update the store here?
  
            // 1. reference the insert actionCreater somehow.
            dispatch(insert({id: id, data: response))
  
            // 2. construct the action manually
            dispatch({action: `${modelName}/insert`, payload: {id: id, data: response))
  
            // 3. Mutate the state here and rely immer. (I'm not sure exactly how that works)
            state[modelName].byId[id] = response
  
            dispatch(finishedLoading({ key: /* */ }))
          } catch (error) {
            dispatch(errorLoading({ key: /* */ }))
          }
        },
        // ...
      }
    })
  }
  </code></pre>