-
Notifications
You must be signed in to change notification settings - Fork 175
Add on(success:failure:)
for adding side-effects.
#51
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
Conversation
Thanks a lot ! Looks great ✨ In my environment, "on()" and "on(&canceller)" are displayed in code completion. |
@tamamachi Since I have already implemented this |
Oh, I meant following 4 candidates were shown and first 2 ones were thought to be unnecessary:
I think this is because default values are specified for args, so maybe we can change the signature How do you think? |
Yes, having Your suggestion on changing arguments to Optional is better, so I fixed it in 3ae32c6. But still, I kept using default parameters for I think it's important to support simple & consistent API (method signature) more than code completion. (In general, using default parameters easily get worse code completion...) |
BTW, even though things may get better, I'm not having plan to rename |
Now it looks all goid for me! 💯 |
Thanks for check! |
Bumped ver 4.1.0. @tamamachi Thanks again! |
Thanks! 🍻 |
This is a new feature and improvement on #50 to add side-effects after completion (success or failure) of task.
Please see SwiftTaskTests.swift#L425-L474 for more detail.
Note
Using
Self
for returning value will fail in Xcode 7.0, but not in 7.1.