Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save drivasperez/87d0712f1d0fc7471cf8410adf50d730 to your computer and use it in GitHub Desktop.
Save drivasperez/87d0712f1d0fc7471cf8410adf50d730 to your computer and use it in GitHub Desktop.
import { Action } from "../../../types/ReducerInterfaces";
import { {{ reducer_name }} } from "../../../types/Users/{{ to_camel_case(reducer_name) }}Interfaces";
import {
FETCH_{{ constant_name }}S,
SEND_NEW_{{ constant_name }},
RESET_SEND_{{ constant_name }}_STATUS,
} from "./rolesConstants";
export const fetch{{ reducer_name }}s = (): Action => ({
type: FETCH_{{ constant_name }}S,
});
export const sendNew{{ reducer_name }} = (user: Role): Action => {
return {
type: SEND_NEW_{{ constant_name }},
payload: {
user,
date: new Date(),
},
};
};
export const resetNew{{ reducer_name }}Status = (): Action => {
return {
type: RESET_SEND_{{ constant_name }}_STATUS,
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment