/// import { recipe, UI } from "commontools"; interface Point { x: number; y: number; } interface State { points: Point[]; scale: number; } export default recipe("DestructuredParam", (state) => { return { [UI]: (
{/* Map with destructured parameter and capture */} {state.points.map(({ x, y }) => (
Point: ({x * state.scale}, {y * state.scale})
))}
), }; });