server/index.js
// this is the first function the session child added hits- directs based on gameID
this is the first function the session child added hits- directs based on gameID
this is the first function the session child added hits - directs based on gameID
function newGameSession(sessionSnap) {
  if (sessionSnap.val().gameId === "1") {
    sessionSnap.ref.child("status").on("value", statusSnap => {
      switchStatusNHIE(statusSnap, sessionSnap);
    });
  } else if (sessionSnap.val().gameId === "2") {
    sessionSnap.ref.child("status").on("value", statusSnap => {
      switchStatusRD(statusSnap, sessionSnap);
    });
  } else if (sessionSnap.val().gameId === "3") {
    sessionSnap.ref.child("status").on("value", statusSnap => {
      switchStatusDAB(statusSnap, sessionSnap);
    });
  }
}
function newGameSession ( sessionSnap ) { if ( sessionSnap . val ( ) . gameId === "1" ) { sessionSnap . ref . child ( "status" ) . on ( "value" , statusSnap => { switchStatusNHIE ( statusSnap , sessionSnap ) ; } ) ; } else if ( sessionSnap . val ( ) . gameId === "2" ) { sessionSnap . ref . child ( "status" ) . on ( "value" , statusSnap => { switchStatusRD ( statusSnap , sessionSnap ) ; } ) ; } else if ( sessionSnap . val ( ) . gameId === "3" ) { sessionSnap . ref . child ( "status" ) . on ( "value" , statusSnap => { switchStatusDAB ( statusSnap , sessionSnap ) ; } ) ; } }
this is the first function the session child added hits- directs based on gameID
this is the first function the session child added hits - directs based on gameID
//getting the status for each session // swtich on snapshot.val().gameID