MCPcopy Create free account
hub / github.com/Snowflyt/tinyeffect / askOnce

Function askOnce

test/koka-samples.spec.ts:138–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136 expect(askConst2()).toEqual(42);
137
138 const askOnce = () => {
139 let count = 0;
140 return addTwice()
141 .handle<"ask", number>("ask", ({ resume, terminate }) => {
142 count++;
143 if (count <= 1) resume(42);
144 else terminate(0);
145 })
146 .runSync();
147 };
148 expect(askOnce()).toEqual(0);
149});
150

Callers 1

Calls 4

addTwiceFunction · 0.85
resumeFunction · 0.85
terminateFunction · 0.85
handleMethod · 0.65

Tested by

no test coverage detected