import {Action, ActionCreator, Dispatch} from 'redux'; import {ThunkAction} from 'redux-thunk'; // Redux action const reduxAction: ActionCreator = (text: string) => { return { type: SET_TEXT, text }; }; // Redux-Thunk action const thunkAction: ActionCreator> = ( text: string ) => { return (dispatch: Dispatch): Action => { return dispatch({ type: SET_TEXT, text }); }; }; // Async Redux-Thunk action const asyncThinkAction: ActionCreator< ThunkAction, IState, void> > = () => { return async (dispatch: Dispatch): Promise => { try { const text = await Api.call(); return dispatch({ type: SET_TEXT, text }); } catch (e) {} }; };