const initialState = {
  historyID: null,
  media: null,
  djID: null,
  startTime: null
};

export default function reduce(state = initialState, action = {}) {
  const { type, payload } = action;
  switch (type) {
  case 'advance':
    return {
      ...state,
      historyID: payload.historyID,
      media: payload.media,
      djID: payload.userID,
      startTime: payload.timestamp
    };
  default:
    return state;
  }
}

@@ -226,16 +226,37 @@
 vance':%0A
+    if (payload) %7B%0A  
     retu
@@ -260,16 +260,18 @@
 eturn %7B%0A
+  
       ..
@@ -278,16 +278,18 @@
 .state,%0A
+  
       hi
@@ -322,16 +322,18 @@
 ,%0A      
+  
 media: p
@@ -346,16 +346,18 @@
 .media,%0A
+  
       dj
@@ -382,16 +382,18 @@
 ,%0A      
+ 
+ 
 startTim
@@ -413,16 +413,142 @@
 mestamp%0A
+      %7D;%0A    %7D%0A    return %7B%0A      ...state,%0A      historyID: null,%0A      media: null,%0A      djID: null,%0A      startTime: null%0A
     %7D;%0A 

clear booth when receiving a null advance