(getAlerts: GetAlertsType<R>)
| 15 | type GetAlertsType<R> = (response: R) => readonly AlertMessageType[] |
| 16 | |
| 17 | function showAlerts<R>(getAlerts: GetAlertsType<R>): (response: R) => void { |
| 18 | return (response: R) => { |
| 19 | const alerts = getAlerts(response) |
| 20 | const addMessage = window.flashMessages?.addMessage |
| 21 | if (addMessage == null || alerts.length === 0) return |
| 22 | alerts.forEach(addMessage) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | export { topicPath, backgroundColor, borderColor, showAlerts } |
no outgoing calls
no test coverage detected