/// import { Cell, ifElse, recipe, UI } from "commontools"; // Reproduction of bug: .get() called on Cell inside ifElse predicate // The transformer wraps predicates in derive(), which unwraps Cells, // but fails to remove the .get() calls export default recipe<{ showHistory: boolean; messageCount: number; dismissedIndex: Cell; }>("Cell .get() in ifElse predicate", ({ showHistory, messageCount, dismissedIndex }) => { return { [UI]: (
{ifElse( showHistory && messageCount !== dismissedIndex.get(),
Show notification
,
Hide notification
)}
), }; });