fetchJsonp(...)
.then(response => response.json(), error => {dispatch(loadingFailed())})
.then(weather => dispatch(receiveWeather(weather)));
<div *ngIf="phrase">
<h2>The Phrase</h2>
Language: {{phrase.language}} <br>
Value: {{phrase.value}}
</div>
React does not guarantee that the state changes are applied immediately.
setState() does not always immediately update the component. It may batch or defer the update until later.
function compare(str1, str2) {
return clearString(str1) === clearString(str2);
}
function clearString(str) {
return str.toLowerCase().replace(/\s/g, '');
}
compare(name, name2) // => true