Auto-reconnect to event stream after 20secs timeout

This commit is contained in:
Deluan
2020-11-09 15:13:32 -05:00
parent 2b1a5f579a
commit 56803d0151
7 changed files with 40 additions and 26 deletions
+12
View File
@@ -0,0 +1,12 @@
export const EVENT_SCAN_STATUS = 'ACTIVITY_SCAN_STATUS_UPD'
const actionsMap = { scanStatus: EVENT_SCAN_STATUS }
export const processEvent = (data) => {
let type = actionsMap[data.name]
if (!type) type = 'EVENT_UNKNOWN'
return {
type,
data: data.data,
}
}