MCPcopy Create free account
hub / github.com/acoyfellow/UserDO / authEffect

Function authEffect

examples/effect/src/worker.ts:50–64  ·  view source on GitHub ↗
(stub: MyAppDO)

Source from the content-addressed store, hash-verified

48}
49
50function authEffect(stub: MyAppDO) {
51 const signupEffect = Effect.tryPromise({
52 try: () => stub.signup({ email, password }),
53 catch: (error: unknown) => new Error(`Signup failed: ${error}`)
54 });
55
56 const loginEffect = Effect.tryPromise({
57 try: () => stub.login({ email, password }),
58 catch: (error: unknown) => new Error(`Login failed: ${error}`)
59 });
60
61 return signupEffect.pipe(
62 Effect.catchAll(() => loginEffect)
63 );
64}
65
66function fullFlow(stub: MyAppDO, title: string, content: string) {
67 return Effect.gen(function* () {

Callers 1

fullFlowFunction · 0.85

Calls 2

signupMethod · 0.45
loginMethod · 0.45

Tested by

no test coverage detected