Skip to content

Releases: d1opensource/fairlight

v1.0.1

09 Jul 15:29
3f0c8fa
Compare
Choose a tag to compare

Added clearCache method to remove all cached API responses.

v1.0.0

21 Jun 17:49
e6b76dd
Compare
Choose a tag to compare

Updated dependencies (React 18)

v0.9.0

26 Jun 13:16
Compare
Choose a tag to compare
  • Exposed apiRequestId (#54)

v0.8.1

15 Apr 00:35
Compare
Choose a tag to compare
  • Fixes bug in useApiQuery when unmounted (#53)

v0.8.0

14 Apr 14:00
926fc62
Compare
Choose a tag to compare
  • [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 use deduplicate: 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, and Response dependencies. All it needs is a fetch polypill now (#44)
  • [bugfix] Fixes bug where content-type: application/json; charset=utf8 is not parsed as JSON (#31)

v0.7.0

10 Apr 20:54
bef3d56
Compare
Choose a tag to compare
  • Adds useErrorBoundary option to useApiQuery
  • [BREAKING] Updates ApiProvider defaults API:
<ApiProvider defaults={{
  useApiQuery: {
    defaultFetchPolicy: 'cache-and-fetch',
    useErrorBoundary: true
  }
}}>

v0.6.2

30 Mar 15:03
83b6948
Compare
Choose a tag to compare
  • Fix regression in exported typescript types

v0.6.1

30 Mar 14:51
Compare
Choose a tag to compare
  • Rewrite of useApiQuery to fix bugs which occur when params change
  • Upgrade typesafe-actions to v5

v0.6.0

27 Mar 13:23
Compare
Choose a tag to compare
  • Adds successCodes option to API request params (#40)
  • Fixes bug where ? is appended if query is empty (#41 )

v0.5.0

17 Mar 23:09
Compare
Choose a tag to compare
  • Implement functional updates for useApiQuery#setData (#32)