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

Function readIt

test/effected.spec.ts:236–247  ·  view source on GitHub ↗
(reader: () => Promise<string>)

Source from the content-addressed store, hash-verified

234 );
235
236 const readIt = (reader: () => Promise<string>) =>
237 effected(function* () {
238 return yield* read();
239 }).handle("read", ({ resume, terminate }) => {
240 reader()
241 .then((value) => {
242 resume(value);
243 })
244 .catch((error: unknown) => {
245 terminate(error as string);
246 });
247 });
248
249 it("should run an asynchronous program", async () => {
250 {

Callers 1

effected.spec.tsFile · 0.85

Calls 5

effectedFunction · 0.90
resumeFunction · 0.85
terminateFunction · 0.85
handleMethod · 0.65
catchMethod · 0.65

Tested by

no test coverage detected