import { pattern, UI } from "commonfabric"; interface Item { id: string; price: number; } interface State { items: Item[]; discount: number; } // FIXTURE: map-callback-schema-params // Verifies: mapWithPattern callback schemas omit params when captures are unused // and include params when captures are used // state.items.map((item) => {item.id}) -> required: ["element"] // state.items.map((item) => {item.price * state.discount}) // -> required: ["element", "params"] // Context: Both callbacks are pattern-owned JSX maps over the same receiver; only the second closes over outer state export default pattern((state) => { return { [UI]: (
{state.items.map((item) => {item.id})}
{state.items.map((item) => ( {item.price * state.discount} ))}
), }; });