///
import { cell, recipe, UI } from "commontools";
export default recipe("ElementAccessBothOpaque", (_state) => {
const items = cell(["apple", "banana", "cherry"]);
const index = cell(1);
return {
[UI]: (
Element Access with Both OpaqueRefs
{/* Both items and index are OpaqueRefs */}
Selected item: {items.get()[index.get()]}
),
};
});