Skip to content

Instantly share code, notes, and snippets.

@alexroan
Created May 20, 2020 11:16
Show Gist options
  • Save alexroan/9d68bedc1e90b7e1f872568fcdd9d3e7 to your computer and use it in GitHub Desktop.
Save alexroan/9d68bedc1e90b7e1f872568fcdd9d3e7 to your computer and use it in GitHub Desktop.
loadWeb3.js
export const loadWeb3 = async (dispatch) => {
dispatch(loggingIn());
let web3 = null;
try{
web3 = await getWeb3();
dispatch(loggedIn(web3));
loadAccount(dispatch, web3);
}
catch(error) {
dispatch(loginFailed(error));
}
return web3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment