The following code is a ngrx 4 reducer could you make it compatible for ngrx 16 so it works with createReducer()

export function reducer(state = initialState, action: any): State {
  switch (action.type) {
    case exportStream.ActionTypes.REQUEST_TABLE_TREE:
      return Object.assign({}, state, {
        isLoading: true,
        editingTable: null,
      });
    case exportStream.ActionTypes.REQUEST_TABLE_TREE_FAIL:
      return Object.assign({}, state, {
        isLoading: false,
        messages: [{severity: 'error', summary: 'Failed to fetch', detail: 'Failed to perform action'}]
      });
    case exportStream.ActionTypes.REQUEST_TABLE_TREE_SUCCESS:
      let selectedExportStream = state.selectedExportStream;
      let selectedItems = [];
      if (selectedExportStream && action.payload.selectedItemsPerExportStream) {

        selectedItems = action.payload.selectedItemsPerExportStream.get(selectedExportStream.id);
      }
      return Object.assign({}, state, {
        isLoading: false,
        tableTree: action.payload.tableTree,
        selectedItems: selectedItems,
        selectedItemsPerExportStream: action.payload.selectedItemsPerExportStream,
        tableTreeChanges: emptytableTreeChanges,
      });

    case exportStream.ActionTypes.SELECT_EXPORT_STREAM:
      return Object.assign({}, state, {
        selectedExportStream: action.payload,
        selectedItems: state.selectedItemsPerExportStream.has(action.payload.id)
          ? state.selectedItemsPerExportStream.get(action.payload.id) : [],
        tableTreeChanges: emptytableTreeChanges
      });
    case exportStream.ActionTypes.CREATE_EXPORT_STREAM:
      return {
        ...state,
        isSaving: true,

      };
    case exportStream.ActionTypes.CREATE_EXPORT_STREAM_SUCCESS:
      let newExportStream: ExportStream = {id: action.payload.tag};
      return {
        ...state,
        isSaving: false,
        exportStreams: [newExportStream, ...state.exportStreams],
        tableTreeChanges: emptytableTreeChanges,
        selectedItems: [],
        defaultRepetitionRates: [...state.defaultRepetitionRates, ...action.payload.repetitionRates],
        selectedExportStream: newExportStream,
        messages: [{
          severity: 'success',
          summary: 'Successfully created ' + action.payload.tag + ' export stream',
          detail: 'Successfully created ' + action.payload.tag + ' export stream',
        }]
      };

    case exportStream.ActionTypes.CREATE_EXPORT_STREAM_FAIL:
      return {
        ...state,
        isSaving: false,
        messages: [{severity: 'error', summary: 'Failed to create exportStream', detail: 'Failed to perform action'}]
      };

    case exportStream.ActionTypes.CREATE_PRIVATE_TABLE:
        return {
          ...state,
          isSaving: true,
        };

    case exportStream.ActionTypes.CREATE_PRIVATE_TABLE_SUCCESS:
      const newTreeAddPrivateTable: TableTree = {...state.tableTree};
      newTreeAddPrivateTable.privateTables.push(action.payload as PrivateTable);

      return {
        ...state,
        isSaving: false,
        tableTreeChanges: emptytableTreeChanges,
        tableTree: newTreeAddPrivateTable,
        messages: [{
          severity: 'success',
          summary: 'Successfully created ' + action.payload.name + ' private table',
          detail: 'Successfully created ' + action.payload.name + ' private table',
        }]
      };

      case exportStream.ActionTypes.CREATE_PRIVATE_TABLE_FAIL:
        return {
          ...state,
          isSaving: false,
          messages: [{severity: 'error', summary: 'Failed to create private table', detail: 'Failed to perform action'}]
        };

      case exportStream.ActionTypes.UPDATE_PRIVATE_TABLE:
        return {
          ...state,
          isSaving: true,
        };

    case exportStream.ActionTypes.UPDATE_PRIVATE_TABLE_SUCCESS:
      const newTree: TableTree = {
        ...state.tableTree,
        privateTables: state.tableTree.privateTables.map(privateTable => {
          if(action.payload.id == privateTable.id) {
            return action.payload as PrivateTable;
          }
          return privateTable as PrivateTable;
        }),
      };

      return {
        ...state,
        isSaving: false,
        tableTreeChanges: emptytableTreeChanges,
        tableTree: newTree,
        messages: [{
          severity: 'success',
          summary: 'Successfully updated ' + action.payload.name + ' private table',
          detail: 'Successfully updated ' + action.payload.name + ' private table',
        }]
      };

    case exportStream.ActionTypes.UPDATE_PRIVATE_TABLE_FAIL:
      return {
        ...state,
        isSaving: false,
        messages: [{severity: 'error', summary: 'Failed to create private table', detail: 'Failed to perform action'}]
      };

      case exportStream.ActionTypes.CREATE_PRIVATE_TABLE_FAIL:
        return {
          ...state,
          isSaving: false,
          messages: [{severity: 'error', summary: 'Failed to create private table', detail: 'Failed to perform action'}]
        };

      case exportStream.ActionTypes.DELETE_PRIVATE_TABLE:
        return {
          ...state,
          isSaving: true,
        };

      case exportStream.ActionTypes.DELETE_PRIVATE_TABLE_SUCCESS:
        const newTreeDeletePrivateTable: TableTree = {
          ...state.tableTree,
          privateTables: state.tableTree.privateTables.filter(privateTable => {
            if(action.payload.id == privateTable.id) {
              return false;
            }
            return true;
          }),
        };

        return {
          ...state,
          isSaving: false,
          tableTreeChanges: emptytableTreeChanges,
          tableTree: newTreeDeletePrivateTable,
          messages: [{
            severity: 'success',
            summary: 'Successfully deleted ' + action.payload.name + ' private table',
            detail: 'Successfully deleted ' + action.payload.name + ' private table',
          }]
        };

      case exportStream.ActionTypes.DELETE_PRIVATE_TABLE_FAIL:
        return {
          ...state,
          isSaving: false,
          messages: [{severity: 'error', summary: 'Failed to create private table', detail: 'Failed to perform action'}]
        };

    case exportStream.ActionTypes.NEW_UPDATE_ITEMS_EXPORTSTREAM:
      return Object.assign({}, state, {
        tableTreeChanges: action.payload
      });

    case
      exportStream.ActionTypes.CREATE_REPETITION_RATE: {
        return {
          ...state,
          isSaving: true
        };
      }

    case
      exportStream.ActionTypes.CREATE_REPETITION_RATE_FAIL: {
        return {
          ...state,
          isSaving: false,
          messages: [{
            severity: 'error',
            summary: 'Failed to update repetetion rate for tableId 0x' + (action.payload.tableId.toString().length < 2 ? "0" : "") + Number(action.payload.tableId).toString(16),
            detail: 'Failed to perform action'
          }]
        };
      }

    case
      exportStream.ActionTypes.CREATE_REPETITION_RATE_SUCCESS: {
        const tempTableTreeCreateRepettionRate: TableTree = {
          ...state.tableTree,
          privateTables: state.tableTree.privateTables.map(privateTable => {
            if(action.payload.tableId == privateTable.tableId) {
              privateTable.repetitionRateInMilliseconds = action.payload.repetitionRateInMilliseconds;
              return privateTable as PrivateTable;
            }
            return privateTable as PrivateTable;
          }),
        };

        return {
          ...state,
          isSaving: false,
          tableTree: tempTableTreeCreateRepettionRate,
          messages: [{
            severity: 'success',
            summary: 'Updated repetetion rate for tableId 0x' + (action.payload.tableId.toString().length < 2 ? "0" : "") + Number(action.payload.tableId).toString(16),
            detail: 'Updated repetetion rate for tableId 0x' + (action.payload.tableId.toString().length < 2 ? "0" : "") + Number(action.payload.tableId).toString(16) + ' successfully',
          }]
        };
      }

    default:
      return state;
  }
}