File "use-download-link-mutation.js"

Full Path: /home/warrior1/public_html/languages/wp-content/plugins/elementor/app/modules/kit-library/assets/js/hooks/use-download-link-mutation.js
File size: 368 bytes
MIME-type: text/x-java
Charset: utf-8

import { useCallback } from 'react';
import { useMutation } from 'react-query';

export default function useDownloadLinkMutation( model, { onError, onSuccess } ) {
	const downloadLink = useCallback(
		() => $e.data.get( 'kits/download-link', { id: model.id }, { refresh: true } ),
		[ model ],
	);

	return useMutation(
		downloadLink,
		{ onSuccess, onError },
	);
}