In my react project, I have the following code.
import uuid from 'uuid';
import { SET_ALERT, REMOVE_ALERT } from './types';
export const setAlert = (msg, alertType, timeout = 5000) => dispatch => {
const id = uuid.v4();
dispatch({
type: SET_ALERT,
payload: { msg, alertType, id }
});
setTimeout(() => dispatch({ type: REMOVE_ALERT, payload: id }), timeout);
};
Here thunk has been used. Im applying saga into the project and I want to rewrite with saga. Since there is no API calls, i dont want to send through via a saga to the reducer. I want to go to the reducer from this action directly. So how can I rewrite without dispatch?