Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Add context info to readme #23

Merged
merged 1 commit into from Aug 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -68,6 +68,11 @@ Check out the [Drizzle Truffle Box](https://github.com/truffle-box/drizzle-box)
// If Drizzle is initialized (and therefore web3, accounts and contracts), fetch data.
// This will update automatically when the contract state is altered.
var storedData = this.props.drizzleStatus.initialized ? this.contracts.SimpleStorage.methods.storedData.data() : 'Loading...'

// To access drizzle via context in constructor add given context type below
Home.contextTypes = {
drizzle: PropTypes.object
}
```

The contract instance has all of its standard web3 properties and methods. For example, sending a transaction is done as normal:
Expand Down