Guest User

Untitled

a guest
Feb 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. export const createTypes = (prefix, ...args) => {
  2. return args.reduce((types, type) => {
  3. [].concat(type).map(v => types[v] = prefix + v)
  4. return types
  5. }, {})
  6. }
  7.  
  8. export const unsync = (type) => {
  9. return [type, `${type}_PENDING`, `${type}_SUCCESS`, `${type}_ERROR`]
  10. }
  11.  
  12. const types = createTypes('products/',
  13. unsync('GET_PRDUCTS'),
  14. 'CLEAR_STATUS',
  15. )
Add Comment
Please, Sign In to add comment