I'm using the tus Protocol to upload files and this protocol has some callback functions. What I'm trying to do is to yield an action and do something else, but I see that I can't use yield inside the callback.
Bellow is a piece of code from the saga function that contains the callback.
const upload = new tus.Upload(payload,
{
endpoint: `${baseURL}files/`,
chunkSize: fileChunkSize,
headers: { 'Authorization': `Bearer ${jwtToken}`, 'SelectedDatabase': selectedDatabase },
onSuccess: () => {
console.log("Upload Finished");
toast.done(toastId);
toastSuccess(`File (${payload.name}) was successfully uploaded.`);
//yield put(sendFilesSuccess()); TODO: how to call this?
}
});
upload.start();
I read something related to channels, but I couldn't understand it very well, so any help would be appreciated.