import { pattern, UI } from "commonfabric"; interface State { sections: { tasks: { label: string }[]; tags: { name: string }[] }[]; } // FIXTURE: map-destructured-opaque-local-capture // Verifies: destructured opaque locals captured by nested map callbacks stay reactive // const { tasks } = section → const tasks = __cf_pattern_input.key("params", "tasks") // nested tag callback reads tasks.length through key("length"), not plain params values export default pattern((state) => ({ [UI]: (
{state.sections.map((section) => { const { tasks } = section; return (
{section.tags.map((tag) => ( {tag.name}:{tasks.length} ))}
); })}
), }));