Effect CommunityEC
Effect Communityβ€’3y agoβ€’
35 replies
schniz

Performance and Stack Overflow Concerns with Recursion in Paginated API Requests

Paginated API requests: I can implement them using recursion but since JS engines don't have TCO it might be off, right? The docs state to manage state with recursion but I'm not so sure about it in terms of performance/stack overflow? πŸ€”
Right now what I'm doing is using Ref for a page counter which gets incremented on every execution of the effect, returning a { _tag: "Eof" } when there are no new pages, and Effect.retryWhile(x => x._tag === "Eof")
Was this page helpful?