Effect CommunityEC
Effect Community3y ago
2 replies
mcsim1997

Unexpected Output from RetryN Function

Hi,
I retry once, so I expect the following code to give me 1, 2
but it prints 1, 2, 3
Is this intended and why?

let count = 0;
export const effect = Effect.async<never, Error, string>((resume) => {
    count++;
    console.log(count);
    resume(Effect.fail(new Error()));
});

await Effect.runPromise(Effect.retryN(effect, 1));
Was this page helpful?