Advertisement
Guest User

Untitled

a guest
Feb 14th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class GameListItem extends BaseComponent {
  2.     constructor(props, context) {
  3.         super(props, context);
  4.         this.state = {
  5.             name: props.name,
  6.             owner: props.owner,
  7.             uid: props.uid,
  8.             status: props.status
  9.         };
  10.         this.handleClick = this.handleClick.bind(this);
  11.     }
  12.  
  13.     handleClick() {
  14.         let inst = this;
  15.         (
  16.             async function() {
  17.                 let res = await inst.engine.async_action({'action': 'join_game', 'data': {'game_uid': inst.state.uid}});
  18.                 console.log('res: ', res);
  19.             }()
  20.         );
  21.     }
  22.  
  23.     render() {
  24.         return (
  25.             <li className="list-group-item" >
  26.                 <ProtectedLink text={this.state.name} classes="game_link" onClick={this.handleClick}/>
  27.             </li>
  28.         );
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement