You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pass progress as percentage to onUpdate callback #50
Currently, the onUpdate callback is called with a progress parameter, which represents the number of parsed lines.
When implementing a GUI, I might want to display the loading state using a determinate progress bar/spinner including a percentage. It would be great, if the onUpdate callback would give me a progress object, such as
where percentage is a number between 0-1 if it is known (undefined otherwise). This should work for all local file types, such as Blob or ArrayBuffer, since the size is already known when starting to parse. Remote streams should work as well, if the Content-Length header is set.
But actually, the percentage would depend on the number of parsed bytes rather than parsed lines, since the size of a buffer or the Content-Length header indicate the byte length. Therefore, the interface should probably be
Activity