Created
May 15, 2018 20:09
-
-
Save p14n/ed08739cd79a6e771dfa6e323beef722 to your computer and use it in GitHub Desktop.
Contract events
This file contains 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
const eventToAction = name => (err, result) => { | |
store.dispatch({ type: "event", name: name, ...result.args }); | |
}; | |
contract.PaidEvent().watch(eventToAction("paid")); | |
contract.ReclaimedEvent().watch(eventToAction("reclaimed")); | |
contract.Instantiated().watch(eventToAction("created")); | |
contract.KilledStateChange().watch(eventToAction("killed")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment