表達(dá)式
如:
fetch(query)
.then(response=>response.json())
.then(json=>this._handleResponse(json.response))
.catch(error=>this.setState({
isLoading: false,
message: 'Something bad happended' + error
})
);
.then(response=>response.json())
.then(json=>this._handleResponse(json.response))
相當(dāng)于
.then(function(response){response.json();})
.then(function(json){this._handleResponse(json.response);})