Description
currently have similar code:
const {
data: screenshotBlob,
isLoading,
error,
} = api.useQuery('get', '/screenshot/{ctMmId}/{time}', {
params: { path: { ctMmId: id, time: timestamp } },
parseAs: 'blob',
});
const screenshotFile = useMemo(
() =>
screenshotBlob
? new File([screenshotBlob], 'screenshot.jpg', { type: 'image/jpeg' })
: undefined,
[screenshotBlob]
);
const screenshotBase64 = useBase64FromFile(screenshotFile);
and would like to hear if you would consider adding something like base64 option to the parseAs prop
so the with this new option my code could be much cleaner:
const {
data: screenshotBase64,
isLoading,
error,
} = api.useQuery('get', '/screenshot/{ctMmId}/{time}', {
params: { path: { ctMmId: id, time: timestamp } },
parseAs: 'base64',
});
Proposal
Consider adding base64 option to parseAs property, which will do the conversion and instead of Blob will return to base64 string?
Extra
Description
currently have similar code:
and would like to hear if you would consider adding something like
base64option to theparseAspropso the with this new option my code could be much cleaner:
Proposal
Consider adding
base64option toparseAsproperty, which will do the conversion and instead of Blob will return to base64 string?Extra