Skip to content

Instantly share code, notes, and snippets.

@apalepu23
Created June 11, 2019 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apalepu23/94992e4b83031daed80c0ca9939f2bc2 to your computer and use it in GitHub Desktop.
Save apalepu23/94992e4b83031daed80c0ca9939f2bc2 to your computer and use it in GitHub Desktop.
Millionaires' Problem Redux Actions
// Redux action for when enigma-js client library has been initialized
export const initializeEnigma = (enigma) => {
return {
type: 'ENIGMA_INITIALIZED',
payload: enigma
};
};
// Redux action for when web3 accounts have been initialized
export const initializeAccounts = (accounts) => {
return {
type: 'ACCOUNTS_INITIALIZED',
payload: accounts
};
};
// Redux action for when millionaires problem has been deployed to a particular address
export const deployMillionairesProblem = (deployedMillionairesProblem) => {
return {
type: 'MILLIONAIRES_PROBLEM_DEPLOYED',
payload: deployedMillionairesProblem
};
};
// Redux action for when richest millionaire's address has been computed
export const computeRichestMillionaire = (richestMillionaire) => {
return {
type: 'RICHEST_MILLIONAIRE_COMPUTED',
payload: richestMillionaire
};
};
// Redux action for notification message has been sent for snackbar display
export const notifyMessage = (notification) => {
return {
type: 'MESSAGE_NOTIFIED',
payload: notification
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment