title: What is the typescript equivalent for Asynchronous action in Redux-toolkit
body: <p>I am trying to add typescript to redux toolkit app. This is a simple counter app, to increase or decrease the counter state by one.
  <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>import {
    createSlice,
    Dispatch,
    PayloadAction
  } from "@reduxjs/toolkit";
  
  export interface CounterState {
    value: number;
  };
  
  const initialState: CounterState = {
    value: 0
  };
  
  export const counterSlice = createSlice({
    name: 'Counter Slice',
    initialState: initialState,
    reducers: {
      increment: (state) =&gt; {
        state.value = state.value + 1;
      },
      decrement: (state) =&gt; {
        state.value = state.value - 1;
      },
      incrementByAmount: (state, action: PayloadAction &lt; number &gt; ) =&gt; {
        state.value = state.value + action.payload;
      }
    }
  });
  
  //What would be the type of "incrementAsync"
  export const incrementAsync: any = (amount: number) =&gt; (dispatch: Dispatch) =&gt; {
    setTimeout(() =&gt; {
      dispatch(incrementByAmount(amount));
    }, 1000);
  };
  
  export const {
    increment,
    decrement,
    incrementByAmount
  } = counterSlice.actions;
  export default counterSlice.reducer;</code></pre>
  </div>
  </div>
  </p>
  <p>What should be the type annotation for <code>incrementAsync</code> instead of the <code>any</code> type I have used just to make it work. The official redux toolkit documentation didn't help me.</p>
  <p>The <code>incrementAsync</code> is just using a timeout function to increase the counter value by one after a delay of one second.</p>