import { IOrderState , IOrder } from "./OrderContracts" ; import produce from "immer" ; import { OrderActionTypes , OrderActionsUnion } from "./OrderActions" ; export function orderReducer ( state , action ) { return produce ( state || { } , draft => { switch ( action . type ) { case OrderActionTypes . AddOrder : { state . order = action . payload . order ; break ; } } } ) ; }