-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
feat: query onError & onComplete callbacks #1097
feat: query onError & onComplete callbacks #1097
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.
Great work! Thanks for contirbuting. I've added a few comments. Please don't hesitate to ask questions if something isn't clear or you don't agree on!
Codecov Report
@@ Coverage Diff @@
## main #1097 +/- ##
==========================================
- Coverage 59.57% 58.97% -0.60%
==========================================
Files 41 41
Lines 1561 1587 +26
==========================================
+ Hits 930 936 +6
- Misses 631 651 +20
Continue to review full report at Codecov.
|
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.
Great Job, this is a very well done job, and happy to see that you are new on the repository.
I have a couple of style comments and also I would like your idea to put the QueryCallbackHandler
in a new file maybe query_callback.dart
?
and also move the following code in a new file called types.dart
, I'm not a fan of the typedef but maybe if we refactor all in one class I can have a reason change my mind :)
typedef OnQueryCompleted = FutureOr<void> Function(dynamic data);
typedef OnQueryError = FutureOr<void> Function(OperationException? error);
In addition, can rename the commit header to |
355866b
to
7fdb530
Compare
@vincenzopalazzo @budde377 hi, thanks for your comments! i've resolved all of the issues you had commented about |
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.
Just some questions on the syntax type used.
Sorry, but I considered an important feature for the named optional parameter, because make the call of the method less messy.
LGTM, and again great job! Let's see what the CI says. In addition, sorry if my comments can sound frustrating, but it is not I'm only a person that care to the elegance of a programming language :) |
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.
Thanks for updating! I've added a few comments, but this is really close to ship!
7fdb530
to
67c77dd
Compare
i've fixed the remaining issues :) |
The CI was saying that there is some test to update
|
@vincenzopalazzo i can't verify because I can't re-run the CI action, but locally it seems that the the missing type related issues are definitely fixed for me locally once I symlink everything with melos |
Yeah! right this now is tricky, we should split the PR in two, but maybe I will test it locally and after I merge a will fix the CI |
@vincenzopalazzo how should i proceed here? |
Nothing from your side, I need to split the PR in two, but this required time, and now there are Italian holidays. I will try to find some time for the end of the week The problem here is that the breaking chain needs to be divided into two PRs because we want that This was my missing during the review, sorry! |
e41d204
to
be71750
Compare
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
be71750
to
f782ac1
Compare
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.
Fixed the analyzer error that makes the CI unhappy and squashes some commits with no meaning!
Fixes / Enhancements
Added
onError
&onCompleted
callbacks to the Query widget anduseQuery
hook. They work pretty much exactly as the same callbacks for Mutations.Fixes: #954
Let me know if anything needs changing, I'm new to the Dart & Flutter ecosystem, but I'll try my best!