/**
 * Update Code Action
 */ const CODE_UPDATE = 'CODE_UPDATE' ; type UpdateAction = { type : 'CODE_UPDATE' ; code : string ; } ; export const update = ( code ) : UpdateAction => ( { type : CODE_UPDATE , code , } ) ; TODO export type CodeState = { code : string ; } ; /**
 * Code Action
 */ export type CodeAction = UpdateAction | any ; /**
 * Initial Code State
 *
 * `code` is the string value of the code
 */ const initialState = { code : '' , } ; /**
 * Code Reducer
 */ export default function codeReducer ( state = initialState , action ) { switch ( action . type ) { case CODE_UPDATE : return Object . assign ( { } , state , { code : action . code } ) ; } return state ; }