Skip to content

Instantly share code, notes, and snippets.

@Rajatgms
Last active August 6, 2020 01:49
Show Gist options
  • Save Rajatgms/87b256f78f14ddf5cdf889f07fec68e7 to your computer and use it in GitHub Desktop.
Save Rajatgms/87b256f78f14ddf5cdf889f07fec68e7 to your computer and use it in GitHub Desktop.
actionCreator
export const NOTIFY_SUCCESS = 'NOTIFY_SUCCESS';
export const NOTIFY_ERROR = 'NOTIFY_ERROR';
export const NOTIFY_RESET = 'NOTIFY_RESET';
export const notifySuccessAction = payload => ({ type: NOTIFY_SUCCESS, payload });
export const notifyErrorAction = payload => ({ type: NOTIFY_ERROR, payload });
export const notifyResetAction = () => ({ type: NOTIFY_RESET });
import { createAction } from '@reduxjs/toolkit';
export const notifySuccessAction = createAction('NOTIFY_SUCCESS');
export const notifyErrorAction = createAction('NOTIFY_ERROR');
export const notifyResetAction = createAction('NOTIFY_RESET');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment