Guest User

Untitled

a guest
Jan 17th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import { fetchPresentation } from './presentation.actions';
  2. import { SpinningWheel } from './spinning-wheel';
  3.  
  4. class Menu {
  5. render() {
  6. return (
  7. <button onClick={this.onButtonClick}>
  8. {this.state.isOpening ? <SpinningWheel /> : 'Open presentation'}
  9. </button>
  10. );
  11. }
  12.  
  13. private onButtonClick = async () => {
  14. this.setState({isOpening: true});
  15. try {
  16. await fetchPresentation();
  17. }
  18. finally {
  19. this.setState({isOpening: false});
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment