Created
May 8, 2020 11:39
-
-
Save alexroan/233b5627a6858010d5684c5ded6bcffc to your computer and use it in GitHub Desktop.
socketSubscription.js
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
export const subscribeToTransferEvents = async (dispatch, tennisPlayer, tennisPlayerSocket, account) => { | |
tennisPlayerSocket.events.Transfer({filter: {to: account}}) | |
.on('data', async function(event){ | |
await loadOwnedPlayers(dispatch, tennisPlayer, account); | |
dispatch(playerCreated()); | |
}) | |
.on('error', console.error); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment