export function mapModuleState(nesting, states = []) { if (!Array.isArray(nesting)) nesting = [nesting]; const res = {}; for (const stateName of states) { res[stateName] = (state) => { let obj = state; for (const key of nesting) obj = obj[key]; return obj[stateName]; }; } return mapState(res); }
export function mapModuleState(nesting, states = []) { if (!Array.isArray(nesting)) nesting = [nesting]; const res = {}; for (const stateName of states) { res[stateName] = (state) => { let obj = state; for (const key of nesting) obj = obj[key]; return obj[stateName]; }; } return mapState(res); }