Skip to content

Releases: marcin-piela/react-fetching-library

1.7.6

22 Feb 07:52
Compare
Choose a tag to compare

1.7.5

08 Jan 11:01
Compare
Choose a tag to compare
  • Reset payload in useQuery when re-rendered with changed query -#110

1.7.4

26 Mar 11:47
Compare
Choose a tag to compare

Fixes

  • #84 - handleReload from useQuery hook fired with old client instance after client update

1.7.3

26 Mar 10:44
Compare
Choose a tag to compare

Fixes

  • #84 - queries were fired with old client instance after client update

1.7.1

23 Mar 19:56
4cf086b
Compare
Choose a tag to compare

Improvements

  • Allow to easily use axios with all features - example

1.7.0

25 Feb 17:02
de49624
Compare
Choose a tag to compare

Improvements

  • New way of extending base Action in TS - more info here

Breaking changes

  • Old way of extending Action type in TS is not working anymore

1.6.4

24 Feb 18:30
Compare
Choose a tag to compare

Fix

  • TS types of client context

1.6.2

24 Feb 17:01
Compare
Choose a tag to compare

Features

1.6.1

20 Feb 20:33
Compare
Choose a tag to compare

1.6.0

20 Feb 20:21
0067edf
Compare
Choose a tag to compare

Improvements

  • package size reduction (replace tsc with rollup and closure compiler)
  • allow to define response TS type directly in action definition
type UsersResponse = {
    data: User[];
    meta: any;
}

export const fetchUsersList: Action<UsersResponse> = {
  method: 'GET',
  endpoint: '/users',
};

and then you can skip type in component ie.

const { payload } = useQuery(fetchUsersList)

instead of

const { payload } = useQuery<UsersResponse>(fetchUsersList)

Breaking changes

  • MutateContext and QueryContext have been removed - it's easier to create own context in application
  • First parameter for Action type is now response type, to extend base Action (ie. to add some new params) you have to create type like that:
import { Action as BaseAction } from 'react-fetching-library';

export type Action<T = any, K = { skipAuth?: boolean; }> = BaseAction<T, K>;