Skip to content

Instantly share code, notes, and snippets.

@alexroan
Last active May 8, 2020 11:36
Show Gist options
  • Save alexroan/d47d03328ba9fb5cf7ea2285e17df46c to your computer and use it in GitHub Desktop.
Save alexroan/d47d03328ba9fb5cf7ea2285e17df46c to your computer and use it in GitHub Desktop.
loadingTwoContracts.js
export const loadTennisPlayerContract = async (dispatch, web3, address) => {
const instance = new web3.eth.Contract(TennisPlayer.abi, address);
dispatch(tennisPlayerLoaded(instance));
return instance;
}
export const loadTennisPlayerSocket = async (dispatch, web3Socket, address) => {
const socketInstance = new web3Socket.eth.Contract(TennisPlayer.abi, address);
dispatch(tennisPlayerSocketLoaded(socketInstance));
return socketInstance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment