((state) => {
return {
[NAME]: computed(() => `Simple counter: ${state.value}`),
[UI]: (
dec to {previous(state.value)}
Counter is the {nth(state.value)} number
inc to {state.value + 1}
),
value: state.value,
};
});
interface FactoryInput {
// Provided by the shell; not used directly here
allCharms: Default;
}
// No additional outputs beyond name and UI
type FactoryOutput = {
[NAME]: string;
[UI]: any;
};
type InputEvent = { detail: { message: string } };
const newCounter = handler>((_, __) => {
const charm = Counter({ value: Math.round(Math.random() * 10) });
return navigateTo(charm);
});
export default pattern((_) => {
return {
[NAME]: "Counter Factory",
[UI]: (
),
};
});