SkynetLabs / skynet-js

A Javascript module made to simplify communication with Sia Skynet portals from the browser.
https://sdk.skynetlabs.com
MIT License
68 stars 9 forks source link

Define `onUploadProgress` signature in docs #546

Open MSevey opened 2 years ago

MSevey commented 2 years ago

Clearly define the method signature and what values get passed to onUploadProgress (outside of suggesting how to call it in the code samples).

parajbs commented 2 years ago

Hello MSevey,

Not quite sure what you mean by method signature.

I just tested the "onUploadProgress" function with "uploadFile" as specified in sdk-doc "https://sdk.skynetlabs.com/?javascript--browser#setting-additional-options" and it works great.

The output from the "onUploadProgress" function is displayed in the browser console.

If you want an output on the website as a progress bar, you simply have to send the values of "*Progress ${Math.round(progress 100)}%" to the PrograsBar from the example from the "onUploadProgress"** function.

"onUploadProgress" only works in "skynet-js" at the moment.

I hope I could help, but I may have misunderstood you.