-
Notifications
You must be signed in to change notification settings - Fork 8
Add mapAsync #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mapAsync #96
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG.
pure unit | ||
Running fiber -> | ||
launchAff_ do | ||
killFiber (error "Cancelled") fiber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
killFiber (error "Cancelled") fiber | |
killFiber cancelledError fiber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. But I wonder why tests didn't catch it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no tests for cancel
I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No direct test, but this one should cancel the task internally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, mapAsync doesn't call cancel
, only run
which calls killFiber directly. So this function is unnecessary
* Add mapAsync * Doc comment * Remove warning * Remove unnecessary code
Asynchronous version of
map
, for easily integrating e.g. network requests into a FRP computation.