Created by: rogeliog
#521 (closed) This adds some simple documentation for the fetch and Promise polyfills.
@gaearon Should we also add a simple example of how to use this with React? Or do you think it falls out of scope?
class MyComponent extends Component {
state = {}
componentDidMount() {
fetch('/todos.json')
.then((response) => response.json())
.then((todos) => this.setState({ todos: todos }))
.catch((error) => console.log('Error', error));
}
render() {
return <TodoList todos={this.state.todos} />;
}
}