Created
January 19, 2017 11:39
-
-
Save RayLuxembourg/a5f3bef460732a0483d9a42fba1ab834 to your computer and use it in GitHub Desktop.
CRUD CONST CREATOR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Actions = (type) => ({ | |
FETCH: { | |
IN_PROGRESS: `FETCH_${type}_IN_PROGRESS`, | |
SUCCESS: `FETCH_${type}_SUCCESS`, | |
ERROR: `FETCH_${type}_ERROR` | |
}, | |
POST: { | |
IN_PROGRESS: `POST${type}_IN_PROGRESS`, | |
SUCCESS: `POST${type}_SUCCESS`, | |
ERROR: `POST${type}_ERROR` | |
}, | |
UPDATE: { | |
IN_PROGRESS: `UPDATE${type}_IN_PROGRESS`, | |
SUCCESS: `UPDATE${type}_SUCCESS`, | |
ERROR: `UPDATE${type}_ERROR` | |
}, | |
DELETE: { | |
IN_PROGRESS: `DELETE${type}_IN_PROGRESS`, | |
SUCCESS: `DELETE${type}_SUCCESS`, | |
ERROR: `DELETE${type}_ERROR` | |
} | |
}) | |
// FETCH SINGLE | |
export const CONFIGURATIONS = Actions("CONFIGURATIONS"); | |
export const EMPLOYERS = Actions("EMPLOYERS"); | |
export const REPORTS = Actions("REPORTS"); | |
export const PENSIONS = Actions("PENSIONS"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment