Releases: d1opensource/fairlight
Releases · d1opensource/fairlight
v1.0.1
v1.0.0
Updated dependencies (React 18)
v0.9.0
v0.8.1
v0.8.0
- [breaking] Uses
observables
instead of event emitters (#44).onError
must be written like this now:const subscription = api.onError.subscribe(error => { // handle error }) subscription.unsubscribe()
- [breaking] Default
useApiQuery#refetch
to usededuplicate: false
(#49) - [breaking] Removes
withApi
(#44) - [feature] Adds
useMutation
hook (#48)const [createUser, {mutating: creatingUser}] = useApiMutation({ mutation: (firstName: string, lastName: string) => async (api) => { return api.request(UserEndpoints.create({firstName, lastName})) }, onError: (error) => console.error(error), onSuccess: (user) => console.log(`Created user ${firstName}`) }) // usage createUser('Thomas', 'Dashney')
- [feature] Adds basic server-side rendering support by removing
Headers
,Request
, andResponse
dependencies. All it needs is afetch
polypill now (#44) - [bugfix] Fixes bug where
content-type: application/json; charset=utf8
is not parsed as JSON (#31)
v0.7.0
- Adds
useErrorBoundary
option touseApiQuery
- [BREAKING] Updates
ApiProvider
defaults API:
<ApiProvider defaults={{
useApiQuery: {
defaultFetchPolicy: 'cache-and-fetch',
useErrorBoundary: true
}
}}>
v0.6.2
- Fix regression in exported typescript types
v0.6.1
- Rewrite of
useApiQuery
to fix bugs which occur when params change - Upgrade
typesafe-actions
tov5