Adding a communication channel between server and clients using SSE

This commit is contained in:
Deluan
2020-11-08 00:06:48 -05:00
parent 3fc81638c7
commit 2b1a5f579a
15 changed files with 395 additions and 25 deletions
+16
View File
@@ -0,0 +1,16 @@
import { ACTIVITY_SCAN_STATUS_UPD } from '../actions'
export const activityReducer = (
previousState = {
scanStatus: { scanning: false, count: 0 },
},
payload
) => {
const { type, data } = payload
switch (type) {
case ACTIVITY_SCAN_STATUS_UPD:
return { ...previousState, scanStatus: data }
default:
return previousState
}
}