Skip to content

Releases: oberonamsterdam/react-api-data

1.2.0

24 Jun 16:55
b2daec2
Compare
Choose a tag to compare

New features

1.1.2

18 Mar 17:02
Compare
Choose a tag to compare

Fixes

  • Fix a bug with the autoTrigger config override in the useApiData hook
  • Added some deprecation notices on previously deprecated methods

1.1.1

09 Nov 09:25
Compare
Choose a tag to compare

Fixes

  • Fix a problem with redux persist.

1.1.0 React Suspense support

28 Oct 15:35
Compare
Choose a tag to compare

New features

1.0.1 SSR release

12 Oct 09:48
Compare
Choose a tag to compare

New features

  • You can now use getDataFromTree to run your requests from the server side.
    For more info, see the API spec or the new with-next example

Breaking changes

None

Deprecations

None

1.0.0

28 Sep 08:49
980080a
Compare
Choose a tag to compare

New features:

  • It is now possible to provide endpoints with default values for the params. (see docs).
  • It is now possible to provide config overrides in the hook and the hoc (see the config parameter in useApiData).
  • Added property dataFailed, which contains the body of a failed call.
  • The perform promise will now reject, when the request fails.
  • Added possibility to purge individual requests via the binding and the actions.
  • All function names containing ApiData, have been renamed to a name without ApiData. The old names are hereby deprecated and will be removed in a future release.

Breaking changes:

  • The data property no longer contains the data of a failed call.
  • The perform promise will now reject, when the request fails. This means that code depending on a failed response should be moved to the catch clause of the promise.
  • The third parameter of the useApiData hook, changed from instanceId string to an options object, solve this by placing the string in this object: { instanceId: 'myInstanceIdString' }

Deprecations:

  • All function names containing ApiData, have been renamed to a name without ApiData. The old names are hereby deprecated and will be removed in a future release.

Improved callbacks [breaking]

24 Jun 11:29
Compare
Choose a tag to compare

Includes consistent config callbacks for beforeSuccess, afterSuccess, beforeFailed and afterFailed.
Breaking changes:

  • Callback arguments have been combined into one object, so you can easily cherry pick what you need using destructuring.
    Update your code by adding destructuring:
    Old: afterSuccess: (request, dispatch) => {}
    New: afterSuccess: ({ request, dispatch }) => {}