import { Default, handler, NAME, pattern, UI, wish, Writable, } from "commonfabric"; type Item = { name: string; value: number }; const removeItem = handler< Record, { items: Writable>; item: Item } >((_, { items, item }) => { items.remove(item); }); // FIXTURE: map-wish-default-handler-capture // Verifies: wish, []>>().result maps still lower to mapWithPattern with handler captures // wish>(...).result!.map(fn) -> mapWithPattern(pattern(...), { items: items }) // removeItem({ items, item }) -> captures both the reactive array and the current element // Context: The array comes from wish().result rather than a pattern param or a local cell export default pattern>((_) => { const items = wish>({ query: "#items" }).result!; return { [NAME]: "Test", [UI]: (
    {items.map((item) => (
  • {item.name}
  • ))}
), }; });