Closed Xyncgas closed 1 year ago
Depending on how you code “fetch requests”, yes. If your code executes a side effect, each iteration, just like with any enumerable (like seq
) will be iterated again.
However, you can apply multiple map or collect operations at once. They won’t execute until the sequence is executed.
AsyncSeq has a function cache
that you can use to prevent side effects to run again, while keeping late binding operating semantics (that is: cache doesn’t do anything until you start iterating, and if it gets iterated again, the already cached items won’t execute. If it was a partial iteration, the rest will be cached once needed).
Thanks
If I iterate the AsyncSeq multiple times do I make multiple fetch request