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

Commit

Permalink
Merge pull request #43 from pemulis/patch-1
Browse files Browse the repository at this point in the history
a few typo and formatting fixes
  • Loading branch information
OnlyOneJMJQ authored Apr 22, 2018
2 parents 994ac69 + 78061f1 commit c32cfe5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Drizzle is a collection of front-end libraries that make writing dapp frontends

1. Get contract data. Calling the `cacheCall()` function on a contract will execute the desired call and return a corresponding key so the data can be retrieved from the store. When a new block is received, Drizzle will refresh the store automatically _if_ any transactions in the block touched our contract. For more information on how this works, see [How Data Stays Fresh](#how-data-stays-fresh).

**Note:** We have to check that Drizzle is initialized before fetching data. A simple if statement such as below is fine for display a few pieces of data, but a better approach for larger dapps is to use a [loading component](https://github.com/trufflesuite/drizzle-react#recipe-loading-component). We've already built one for you in our [`drizzle-react-components` library](https://github.com/trufflesuite/drizzle-react-components) as well.
**Note:** We have to check that Drizzle is initialized before fetching data. A simple if statement such as below is fine for displaying a few pieces of data, but a better approach for larger dapps is to use a [loading component](https://github.com/trufflesuite/drizzle-react#recipe-loading-component). We've already built one for you in our [`drizzle-react-components` library](https://github.com/trufflesuite/drizzle-react-components) as well.
```javascript
// Assuming we're observing the store for changes.
var state = drizzle.store.getState()
Expand All @@ -63,7 +63,7 @@ Drizzle is a collection of front-end libraries that make writing dapp frontends

1. Send a contract transaction. Calling the `cacheSend()` function on a contract will send the desired transaction and return a corresponding transaction hash so the status can be retrieved from the store. The last argument can optionally be an options object with the typical from, gas and gasPrice keys. Drizzle will update the transaction's state in the store (pending, success, error) and store the transaction receipt. For more information on how this works, see [How Data Stays Fresh](#how-data-stays-fresh).

**Note:** We have to check that Drizzle is initialized before fetching data. A simple if statement such as below is fine for display a few pieces of data, but a better approach for larger dapps is to use a [loading component](https://github.com/trufflesuite/drizzle-react#recipe-loading-component). We've already built one for you in our [`drizzle-react-components` library](https://github.com/trufflesuite/drizzle-react-components) as well.
**Note:** We have to check that Drizzle is initialized before fetching data. A simple if statement such as below is fine for displaying a few pieces of data, but a better approach for larger dapps is to use a [loading component](https://github.com/trufflesuite/drizzle-react#recipe-loading-component). We've already built one for you in our [`drizzle-react-components` library](https://github.com/trufflesuite/drizzle-react-components) as well.
```javascript
// Assuming we're observing the store for changes.
var state = drizzle.store.getState()
Expand Down Expand Up @@ -162,10 +162,10 @@ An object consisting of the type and url of a fallback web3 provider. This is us
status
}
},
transactionStack
transactionStack,
drizzleStatus: {
initialized
}
},
web3: {
status
}
Expand All @@ -181,13 +181,15 @@ A series of contract state objects, indexed by the contract name as declared in
#### `contractName` (object)

`initialized` (boolean): `true` once contract is fully instantiated.

`synced` (boolean): `false` if contract state changes have occurred in a block and Drizzle is re-running its calls.

`events` (array): An array of event objects. Drizzle will only listen for the events we declared in options.

The contract's state also includes the state of each constant function called on the contract (`callerFunctionName`). The functions are indexed by name, and contain the outputs indexed by a hash of the arguments passed during the call (`argsHash`). If no arguments were passed, the hash is `0x0`. Drizzle reads from the store for you, so it should be unnecessary to touch this data cache manually.

`args` (array): Arguments passed to function call.

`value` (mixed): Value returned from function call.

### `transactions` (object)
Expand All @@ -196,7 +198,9 @@ A series of transaction objects, indexed by transaction hash.
#### `txHash` (object)

`confirmations` (array): After the initial receipt, further confirmation receipts (up to the 24th).

`error` (object): contains the returned error if any.

`receipt` (object): contains the first transaction receipt received from a transaction's `success` event.

`status` (string): `true` or `false` depending on transaction status
Expand Down

0 comments on commit c32cfe5

Please sign in to comment.