flatmax / gtkiostream

Trivialised Threading, GTK GUIs, Signal Processing, Neural Networks, Audio Processing, Octave interfacing ... and more !
13 stars 7 forks source link

Run decodeURL on promise #2

Closed mahdiridho closed 5 years ago

mahdiridho commented 5 years ago

Client app need validation decodeURL process

flatmax commented 5 years ago

I don't understand the changes. You've added await and async but haven't described why the changes are required. Please explain in more detail here so it is understandable to a simple programmer, like me :)

mahdiridho commented 5 years ago

oh sorry didn't add desc there, I thought you understand. So async - await, the other way of promise. The client app want to know if the sox has beed loaded or ready. To do that, the sox::decodeURL must be return a knowing value let say true / false.

Because of sox::decodeURL is not a promise, we change it. We can use old approach like

return new Promise((resolve, reject)=>{})

or for the new approach I like, using async await which change the async process to be sync process.

Finally, we can return a value to the client

flatmax commented 5 years ago

OK - you should really add information on the return values to the method comment. I will pull this one, but in future, please adjust the method comments.