Skip to content

Instantly share code, notes, and snippets.

View vldvel's full-sized avatar

Vlad vldvel

  • Amsterdam
View GitHub Profile
const getWeatherDataTimedout = async dispatch => {
await getWeatherData()(dispatch);
setTimeout(() => updateMessages(dispatch), 30 * 1000);
};
const getWeatherDataMiddleware = ({ dispatch }) => next => {
getWeatherDataTimedout(dispatch);
return action => next(action);
const store = createStore(
rootReducer,
compose(applyMiddleware(/** other middlewares */, getWeatherDataMiddleware))
);