UNPKG

instantjob-recruiter-client

Version:

a set of tools for creating an instantjob recruiter react client

22 lines (19 loc) 494 B
import {tolerant_selector} from 'selectors/base' import {remove_alert} from 'actions/display' import store from 'common/store' const get_raw_alerts = (state) => state.display.alerts export const get_alert = tolerant_selector( [get_raw_alerts], (alerts) => { if (Object.keys(alerts).length == 0) { return null } const alert = alerts[Object.keys(alerts)[0]] return { ...alert, remove() { store.dispatch(remove_alert(alert.id)) }, } } )