const isProductAddedToCartSelector = createSelector(
cartProductsSelector, // ( 1 )
productIdSelector, // ( 2 )
(products, id) => products.some(product => product.id === id), // ( 3 )
);
import module1 from './module1';
import module1 from './module2';
...
import module1 from './moduleN';
...
if (module.hot) {
module.hot.accept('./module1', () => { ... });
...
module.hot.accept('./module2', () => { ... });
module.hot.accept('./moduleN', () => { ... });
}
corrected typo
git reset HEAD~1
git reset --soft HEAD^
git push -f
class WeatherWidget extends Component {
this.state = {
weather: '',
city: this.props.city,
};
componentDidMount() {
this.fetchWeatherData();
}
fetchWeatherData() {
axios.get('/api/weather/${this.state.city}')
.then(({ data: weather }) => this.setState({ weather }));
}
handleCitySelectChange = e => {
const { value: city } = e.target;
this.setState({ city }, this.fetchWeatherData);
};
render() {
return ( ... );
}
}
export default bootstrap = (node, city) =>
ReactDOM.render(<WeatherWidget city={city} />, node);