Closed raix closed 3 months ago
Issues
3 New issues
0 Accepted issues
Measures
0 Security Hotspots
6.0% Coverage on New Code
0.0% Duplication on New Code
Please retry analysis of this Pull-Request directly on SonarCloud
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
4.1% Coverage on New Code
0.0% Duplication on New Code
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