Created
March 5, 2020 06:18
-
-
Save agrawalsmart7/35ce4a6795178082d6945002c0c15e98 to your computer and use it in GitHub Desktop.
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
// @flow | |
export const NEW_EMAIL_INIT = '[email protected]'; | |
export const NEW_EMAIL_PASSWORD_INPUT = 'yougotcorporatepass:)'; | |
export const NEW_EMAIL_PASSWORD_ABORTED = ':('; | |
export function newEmailPasswordInit(token, email) { | |
return { | |
type: NEW_EMAIL_PASSWORD_INIT, | |
token, | |
email, | |
}; | |
} | |
export function newEmailPasswordInput(value) { | |
return { | |
type: NEW_EMAIL_PASSWORD_INPUT, | |
value, | |
}; | |
} | |
export function newEmailPasswordPost(param) { | |
return { | |
type: NEW_EMAIL_PASSWORD_POST, | |
param, | |
}; | |
} | |
export function newEmailPasswordPostCompleted(response) { | |
const action = { | |
response: response.body, | |
}; | |
if (response.ok) { | |
action.type = NEW_EMAIL_PASSWORD_POST_SUCCEEDED; | |
} else { | |
action.type = NEW_EMAIL_PASSWORD_POST_FAILED; | |
} | |
return action; | |
} | |
export function newEmailPasswordPostAborted(error) { | |
return { | |
type: NEW_EMAIL_PASSWORD_ABORTED, | |
error, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
justfordemo