| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Thanks a lot ! Looks great ✨ In my environment, "on()" and "on(&canceller)" are displayed in code completion. |
Sorry, something went wrong.
|
@tamamachi Since I have already implemented this &canceller feature in other methods e.g. then(&canceller), I think it is reasonable to continue adding for on() as well for now. Then, next major version bump will be the time to rethink of these implementations again. |
Sorry, something went wrong.
|
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? |
Sorry, something went wrong.
|
Yes, having &canceller parameter is always a downside, but AFAIK, it's not possible remove due to Swift's inout behavior which can't use default parameter. Your suggestion on changing arguments to Optional is better, so I fixed it in 3ae32c6. But still, I kept using default parameters for success and failure because there will be needs to omit one of those argument, i.e. calling on(success:) and on(failure:). 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...) |
Sorry, something went wrong.
|
BTW, even though things may get better, I'm not having plan to rename on(success:) & on(failure:) to separate names e.g. onSuccess() and onFailure() just because it will make confusion with current success() & failure(). |
Sorry, something went wrong.
|
Now it looks all goid for me! 💯 |
Sorry, something went wrong.
|
Thanks for check! |
Sorry, something went wrong.
|
Bumped ver 4.1.0. @tamamachi Thanks again! |
Sorry, something went wrong.
|
Thanks! 🍻 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.