Guest User

Untitled

a guest
Mar 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. export const actionEvent = (reduxMessage: string) => ({
  2. INIT: createAction(`[begin] ${reduxMessage}`),
  3. DONE: createAction(`[end] ${reduxMessage}`),
  4. FAIL: createAction(`[fail] ${reduxMessage}`),
  5. });
  6.  
  7. export const AUTH = {
  8. SEND_CODE: actionEvent('send code'),
  9. SIGN_IN: actionEvent('sign in'),
  10. GET_PASSWORD: actionEvent('get password'),
  11. LOG_OUT: actionEvent('user log out'),
  12. };
  13.  
  14. const error = createReducer<IAuthError>({
  15. [SEND_CODE.FAIL]: saveError, // A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
  16. [SIGN_IN.FAIL]: saveError,
  17. [GET_PASSWORD.FAIL]: saveError,
  18. }, {
  19. error_code: null,
  20. error_message: null,
  21. });
Add Comment
Please, Sign In to add comment