Skip to content

Instantly share code, notes, and snippets.

@MichalZalecki
Created July 5, 2018 12:12
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 MichalZalecki/c762ca055db7702f9b6e58a0cedc227d to your computer and use it in GitHub Desktop.
Save MichalZalecki/c762ca055db7702f9b6e58a0cedc227d to your computer and use it in GitHub Desktop.
BlogEvents.getPastEvents("PostAdded", { fromBlock: 0, filter: { author } }).then(events => {
this.setState({ addedPosts: events.map(e => e.returnValues) });
});
// ...
getPost(gatewayIndex = 0) {
this.fetchPostFromIpfs(gateways[gatewayIndex])
.catch(() => this.retry(gatewayIndex))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment