title: Is it okay to dispatch slice's action from another action in redux-toolkit?
body: <p>I'm using redux-toolkit and have 2 slices: &quot;auth&quot; and &quot;profile&quot;</p>
  <p>auth =&gt; handle information about token<br>
  profile =&gt; handle information about user account</p>
  <p>When user tries to login, I send request to api, that returns me the user token and account information. Then I need to save this information. I put token to corresponding field (in same slice). And I need to put my account information to &quot;profile&quot; slice (login processing takes place in the &quot;auth&quot; slice). Now i'm just dispatch setProfile action from 'auth' slice.</p>
  <p>Is it anti-pattern to dispatch &quot;profile&quot; action from &quot;auth&quot; slice?
  Or I have to move this logic from redux to component?
  Or make &quot;login&quot; action outside of slice?
  Or do I need to keep it all in one slice?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// PROFILE SLICE | profile.js 
  
  const initialState = {
    data: {},
    status: 'idle'
  }
  
  export const profileSlice = createSlice({
    name: 'profile',
    initialState,
    reducers: {
      setProfile(s, {payload: profile}) {
        s.profile = profile
      }
    }
  })
  
  export const {setProfile} = userSlice.actions;
  export default profileSlice.reducer
  
  
  // AUTH SLICE | auth.js
  
  import {setProfile} from './profile' // import action creator from profile slice
  
  const initialState = {
    token: null,
    status: 'idle'
  }
  
  export const authSlice = createSlice({
    name: 'auth',
    initialState,
    reducers: {
      setToken(s, {payload: token}) {
        s.token = token
      }
    }
  })
  
  export const login = ({email, password}) =&gt; dispatch =&gt; {
    return api.auth.login({
      email,
      password
    })
      .then(res =&gt; {
        const {token, ...profile} = res.data
        dispatch(setToken(token))
        dispatch(setProfile(profile)
      })
  }
  
  export const {setToken} = authSlice.actions;
  export default authSlice.reducer</code></pre>
  </div>
  </div>
  </p>