-
Notifications
You must be signed in to change notification settings - Fork 30
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
Improve the ergonomics of data loading in the front-end #558
Improve the ergonomics of data loading in the front-end #558
Conversation
Quality Gate passedIssues Measures |
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.
Let me take a look. Please update the pull-request description, so it includes all the details of what is changed and why. It's the only dokumentation we have :)
application/account-management/Application/AccountRegistrations/StartAccountRegistration.cs
Outdated
Show resolved
Hide resolved
application/shared-kernel/ApiCore/SchemaProcessor/StronglyTypedDocumentProcessor.cs
Outdated
Show resolved
Hide resolved
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.
I don't have more comments, except for pull-request description. And I would always a bit cleaner commit history.
Plus fix the SonarCloud warnings :)
But overall, this is just awesome :)
24e831c
to
dbfb99f
Compare
Please retry analysis of this Pull-Request directly on SonarCloud |
…or get client methods
01b6347
to
eb918df
Compare
Quality Gate passedIssues Measures |
Summary & Motivation
Wrap the
openapi-fetch
client as an easy to use client specific to React and PlatformPlatform.Action
support matching the new React api'suseFormState
/useActionState
useApi
hook for easy data loading, with build in state managementProblemDetails
formatExamples of usage
React hook:
useApi
- SimpleThe hook can be used to simply get the
data
from the server, but also providesloading
,success
state and problem detail info liketype
/status
/title
/detail
anderrors
compatible withReact Aria Components
validation in forms.React hook:
useApi
- Debounced fetchingFor use with debounced search etc. and threshold of min 3 chars before fetching the result:
Use with
useFormState
/useActionState
The
action
is passed to theForm
component anderrors
can be passed directly tovalidationErrors
:Plain fetch
The result will always be the data and the api client throws
ProblemDetailsError
Checklist