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

Function fetchAdminData

test/README.example.spec.ts:31–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 });
30
31 const fetchAdminData = () =>
32 effected(function* () {
33 yield* requiresAdmin();
34 const data = yield* effectify(
35 fetch("https://jsonplaceholder.typicode.com/todos/1").then((res) => res.json()),
36 );
37 yield* log("Fetched data: " + JSON.stringify(data));
38 });
39
40 const program = fetchAdminData()
41 .resume("log", (msg) => console.log(msg))

Callers 1

Calls 3

effectedFunction · 0.90
effectifyFunction · 0.90
requiresAdminFunction · 0.70

Tested by

no test coverage detected