Skip to content

Instantly share code, notes, and snippets.

@alant
alant / Home.js
Last active December 24, 2018 10:56
...
class Home extends Component {
componentDidUpdate(prevProps) {
const { onGetStoredValue } = this.props;
if (this.props.SimpleStorage.initialized && this.props.SimpleStorage.initialized !== prevProps.SimpleStorage.initialized) {
onGetStoredValue();
}
if (this.props.txSuccessful && prevProps.txSuccessful === false) {
onGetStoredValue();
}
@alant
alant / App.js
Last active December 24, 2018 10:50
...
class App extends Component {
constructor(props, context) {
super(props);
const { onSetDrizzleState } = this.props;
onSetDrizzleState(context.drizzle);
}
render() {
const { classes, onCheckingTxDone } = this.props;
...
const drizzleOptions = {
contracts: [SimpleStorage]
};
const initialState = {
contracts: generateContractsInitialState(drizzleOptions)
};
// Redux DevTools
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const sagaMiddleware = createSagaMiddleware();

#nothing much