(msg, alertType, timeout = 5000)
| 2 | import { SET_ALERT, REMOVE_ALERT } from './types'; |
| 3 | |
| 4 | export const setAlert = (msg, alertType, timeout = 5000) => dispatch => { |
| 5 | const id = uuidv4(); |
| 6 | dispatch({ |
| 7 | type: SET_ALERT, |
| 8 | payload: { msg, alertType, id } |
| 9 | }); |
| 10 | |
| 11 | setTimeout(() => dispatch({ type: REMOVE_ALERT, payload: id }), timeout); |
| 12 | }; |
no outgoing calls
no test coverage detected