redux-action-names
v0.0.2
Published
Standard actions names for Flux
Downloads
3
Maintainers
Readme
Standard Action Names for Flux
Install
npm install redux-action-names --save-dev
Usage
var actionNames = require('redux-action-names');
var names = actionNames('users');
names
will contain an object:
{
USERS_FETCH_START: 'USERS_FETCH_START',
USERS_FETCH_SUCCESS: 'USERS_FETCH_SUCCESS',
USERS_FETCH_ERROR: 'USERS_FETCH_ERROR',
USERS_UPDATE_START: 'USERS_UPDATE_START',
USERS_UPDATE_SUCCESS: 'USERS_UPDATE_SUCCESS',
USERS_UPDATE_ERROR: 'USERS_UPDATE_ERROR',
USERS_CREATE_START: 'USERS_CREATE_START',
USERS_CREATE_SUCCESS: 'USERS_CREATE_SUCCESS',
USERS_CREATE_ERROR: 'USERS_CREATE_ERROR',
USERS_DELETE_START: 'USERS_DELETE_START',
USERS_DELETE_SUCCESS: 'USERS_DELETE_SUCCESS',
USERS_DELETE_ERROR: 'USERS_DELETE_ERROR',
// Object also contains aliases
fetchStart: 'USERS_FETCH_START',
fetchSuccess: 'USERS_FETCH_SUCCESS',
fetchError: 'USERS_FETCH_ERROR',
updateStart: 'USERS_UPDATE_START',
updateSuccess: 'USERS_UPDATE_SUCCESS',
updateError: 'USERS_UPDATE_ERROR',
createStart: 'USERS_CREATE_START',
createSuccess: 'USERS_CREATE_SUCCESS',
createError: 'USERS_CREATE_ERROR',
deleteStart: 'USERS_DELETE_START',
deleteSuccess: 'USERS_DELETE_SUCCESS',
deleteError: 'USERS_DELETE_ERROR',
// Promise aliases
fetchPromise: ["USERS_FETCH_START", "USERS_FETCH_SUCCESS", "USERS_FETCH_ERROR"],
updatePromise: ["USERS_UPDATE_START", "USERS_UPDATE_SUCCESS", "USERS_UPDATE_ERROR"],
createPromise: ["USERS_CREATE_START", "USERS_CREATE_SUCCESS", "USERS_CREATE_ERROR"],
deletePromise: ["USERS_DELETE_START", "USERS_DELETE_SUCCESS", "USERS_DELETE_ERROR"]
}