Is any event available to listen for all uploads completed #195
Replies: 2 comments
-
this is pretty much a duplicate of #123 It is therefore a conscious design decision not to add this event type to Uploady. Its not something I feel should be the responsibility of the library internals (and can be tricky to implement). That said, a 3rd party enhancer can be written that adds this functionality as a community driven feature. |
Beta Was this translation helpful? Give feedback.
-
I am a little bit late but I wanted to share my solution. What I did was to store the entries and the uploading flag in state:
and calculate how many pending items exist in my state:
I then update the entries state during the following events:
I listen to the itemStart event where I just set the uploading flag / state to true:
The final touch is a simple useEffect hook with the following logic:
The key is to keep the entries state in-sync with your application logic. In my case I always have autoUpload to false and the user uploads the files by clicking a button and he can also remove pending files before (but NOT during) the upload where I also make sure to abort and remove it also from my state. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Does Uploader has any event which can be listened on when all files added has been uploaded. Here is the scenario -
Now i want to have an event like -
Currently i have made a hack by listening UPLOADER_EVENTS.ITEM_FINISH and increasing count every time this is called and then compare with total number of files i am uploading.
Beta Was this translation helpful? Give feedback.
All reactions