Releases: marcin-piela/react-fetching-library
Releases · marcin-piela/react-fetching-library
1.7.6
1.7.5
1.7.4
1.7.3
1.7.1
1.7.0
1.6.4
Fix
- TS types of client context
1.6.2
Features
useBulkMutation
hook #75 - thanks for @josejulio
1.6.1
Features
1.6.0
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
andQueryContext
have been removed - it's easier to create own context in application- First parameter for
Action
type is now response type, to extend baseAction
(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>;