title: How to get the action type from redux toolkit
body: <p>I created a <code>Slice</code> using <code>createSlice</code> from redux toolkit and exported my action such as:</p>
  
  <pre><code>export const { myAction } = slice.actions;
  </code></pre>
  
  <p>I am trying to create a middleware to catch some action type:</p>
  
  <pre><code>import myAction from './reducers/mySlice'
  
  const MyMiddleware = store =&gt; next =&gt; action =&gt; {
    if (action.type === myAction.type) {   //this doesn't work, myAction is a function
      doSomething(action.payload);
    }
     return next(action);
  };
  </code></pre>
  
  <p>I was wondering if it was possible to get the action type as a constant from the slice I created?</p>