///
import { cell, derive, lift } from "commontools";
const stage = cell("initial");
const attemptCount = cell(0);
const acceptedCount = cell(0);
const rejectedCount = cell(0);
const normalizedStage = lift((value: string) => value)(stage);
const attempts = lift((count: number) => count)(attemptCount);
const accepted = lift((count: number) => count)(acceptedCount);
const rejected = lift((count: number) => count)(rejectedCount);
const _summary = derive(
{
stage: normalizedStage,
attempts: attempts,
accepted: accepted,
rejected: rejected,
},
(snapshot) =>
`stage:${snapshot.stage} attempts:${snapshot.attempts}` +
` accepted:${snapshot.accepted} rejected:${snapshot.rejected}`,
);