import * as actions from "@nteract/actions" ; import { makeMessagesRecord } from "@nteract/types" ; import { List } from "immutable" ; import { Action , AnyAction , Reducer } from "redux" ; import { combineReducers } from "redux-immutable" ; export const messageQueue = ( state = List < AnyAction > ( ) , action ) : List < AnyAction > => { switch ( action . type ) { case actions . ENQUEUE_ACTION : return state . push ( action ) ; case actions . CLEAR_MESSAGE_QUEUE : return state . clear ( ) ; default : return state ; } } ; export const messages = combineReducers ( { messageQueue } , makeMessagesRecord as any ) ;