import { List , Map } from 'immutable' ; import { ITables , ITable , TableRecord } from './tables.types' ; export function deimmutifyTables ( state ) { return state . toJS ( ) ; } export function reimmutifyTables ( plain ) { return List < ITable > ( plain ? plain . map ( reimmutifyTable ) : [ ] ) ; } function reimmutifyTable ( table ) { return TableRecord ( Object . assign ( { } , table , { order : Map < number , number > ( table . order ) , } ) ) ; }