Doing a put in progress callback

Viewed 774

I am using a library that offers a .progress callback. It does a fetch and on progress it triggers this callback. I am doing it like this:

    const res = yield call(function fetchDownload() {
        return RNFetchBlob.config({ fileCache:true }).fetch('GET', url)
        .progress(function* progressDownload(received, total) {
            console.log(`progressed received: "${received}" total: "${total}"`);
            yield put(update(url, { progress:received/total }));
        });
    });

However the progressDownload callback never triggers. If I remove the superstar from function* progressDownload it then triggers and I see the console.log, however the put has no effect.

I am using RNFetchBlob, a React Native lib, here is the docs on its progress callbacker - https://github.com/wkh237/react-native-fetch-blob/#user-content-uploaddownload-progress

2 Answers
Related