@randy.tarampi/jsx
Version:
Some common JSX components for www.randytarampi.ca
14 lines (12 loc) • 385 B
JavaScript
import { CLEAR_ERROR } from "../actions/error/clearError";
import selectors from "../data/selectors";
export var errorMiddleware = store => next => action => {
if (action.type === CLEAR_ERROR) {
var timeoutId = selectors.getErrorTimeoutHandlerId(store.getState());
if (timeoutId) {
clearTimeout(timeoutId);
}
}
next(action);
};
export default errorMiddleware;