LayerXcom / vyper-remix

Remix Vyper Plugin
Apache License 2.0
17 stars 36 forks source link

Show "now compiling..." #79

Open nrryuya opened 5 years ago

yudetamago commented 5 years ago

Maybe it is a better way to use componentDidMount(). (https://reactjs.org/docs/react-component.html#componentdidmount)

  1. Click compile button
  2. Render now compiling...
  3. (componentDidMount() is called)
  4. In componentDidMount(), set {compiling: true} to react state
  5. (render() is called again)
  6. If {compiling: true} is set, make http post request to vyper-serve
  7. When getting the compilation result, display it to DOM.

(and set {compiling: false} in the appropriate place)

ref: https://dev.to/sadarshannaiynar/react---asynchronous-component-rendering-wrapper-2pmo