import { StreamAction , TimestampState } from '../types' ; const initialState = 0 ; private param { TimestampState = initialState param { StreamAction } action return { TimestampState } export function timestampReducer ( state = initialState , action ) { if ( action . payload && typeof action . payload . timestamp !== 'undefined' ) { return action . payload . timestamp ; } return state ; }