/** * FUTURE REPRO: patternized map callbacks should follow object aggregate aliases * * If a reactive field is first packed into a local object aggregate, later * computations over that aggregate should still lower correctly. */ import { Default, pattern, UI, VNode, Writable, } from "commonfabric"; interface FileEntry { name: string; type: "file" | "folder"; } interface Input { files: Writable>; } interface Output { [UI]: VNode; } export default pattern(({ files }) => { return { [UI]: (
{files.map((file) => { const meta = { kind: file.type }; const isFolder = meta.kind === "folder"; return {isFolder ? file.name : "locked"}; })}
), }; });