Last active
July 21, 2017 21:24
-
-
Save glortho/c4b5d11348f8335969622ff4503e98b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { users } from './api_decorator'; | |
@users | |
export default class RawApiExample extends React.Component { | |
handleClick = () => this.props.users.api.post( '/1/albums', {} ) | |
render() { | |
return ( | |
<div> | |
<button onClick={ this.handleClick }>FOO!</button> | |
<div> | |
{ this.props.users.api.$get( '/1/albums' ).map(({ data }) => ( | |
<span key={ data.id }>{ data.title }</span> | |
))} | |
</div> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment