/// import { Cell, derive, handler, NAME, pattern, str, UI } from "commontools"; const adder = handler((_, state: { values: Cell }) => { state.values.push(Math.random().toString(36).substring(2, 15)); }); export default pattern<{ values: string[] }>(({ values }) => { derive(values, (values) => { console.log("values#", values?.length); }); return { [NAME]: str`Simple Value: ${values.length || 0}`, [UI]: ( Add Value {values.map((value, index) => ( {index}: {value} ))} ), values, }; });