Skip to content

Instantly share code, notes, and snippets.

@agrawalsmart7
Created March 5, 2020 06:18
Show Gist options
  • Save agrawalsmart7/35ce4a6795178082d6945002c0c15e98 to your computer and use it in GitHub Desktop.
Save agrawalsmart7/35ce4a6795178082d6945002c0c15e98 to your computer and use it in GitHub Desktop.
// @flow
export const NEW_EMAIL_INIT = 'testing@cloudsek.com';
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,
};
}
@agrawalsmart7
Copy link
Author

justfordemo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment