redux thunk action creator

Solutions on MaxInterview for redux thunk action creator by the best coders in the world

showing results for - "redux thunk action creator"
Valeria
02 Mar 2020
1/* Redux-Thunk Action Creator */
2const createAction = () => { type: 'ACTION_TYPE' };
3
4function createAsyncAction() {
5	return (dispatch) => {
6		setTimeout(() => {
7      		dispatch(createAction());
8          	/* ^ invoke sync or async actions with dispatch */
9    	}, 1000);
10	}
11}
12
13/* About Redux-Thunk Actions
14 * redux-thunk allows you to write action creators
15 * that return a function instead of an action
16 */