import { Action, ActionCreatorsMapObject, AnyAction } from 'redux'; import { ThunkAction as _ThunkAction } from 'redux-thunk'; import { CombinedState } from '../reducers/interfaces'; export interface ActionWithPayload extends Action { payload: P; } export function createAction(type: T): Action; export function createAction(type: T, payload: P): ActionWithPayload; export function createAction(type: T, payload?: P) { return typeof payload === 'undefined' ? { type } : { type, payload }; } export type ActionUnion = ReturnType; export type ThunkAction = _ThunkAction;