trufflesuite / drizzle

Reactive Ethereum dapp UI suite
906 stars 238 forks source link

Drizzle react plugin for React Native #90

Open youngkidwarrior opened 4 years ago

youngkidwarrior commented 4 years ago

The legacy codebase has this paradigm setup for RN

componentDidMount() {
    this.unsubscribe = drizzle.store.subscribe(() => {
      const drizzleState = drizzle.store.getState();
      if (drizzleState.drizzleStatus.initialized) {
        this.setState({ loading: false, drizzleState });
      }
    });
  }
  componentWillUnmount() {
    this.unsubscribe();
  }

How compatible is using Drizzle Context with store.subscribe and is it necessary?