getMutation
Almost the same as getQuery
, it is just used for mutations:
import { getMutation } from '@redux-requests/core';
const deleteBookMutation = getMutation(state, { type: 'DELETE_BOOK' });/* for example { loading: false, error: null, pending: 0 // number of pending requests downloadProgress: null, // only when requestAction.meta.measureDownloadProgress is true uploadProgress: null, // only when requestAction.meta.measureUploadProgress is true} */
It accept type
and optionally requestKey
props, which work like for queries.