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 }}
This repository has been archived by the owner on Oct 9, 2021. It is now read-only.
I do not like the (success) => ... setup either. Funny thing is, none of the functions beside mpg123.write is actually asynchronous. This was just how speaker was setup, so it went in a similar direction here.
My solution in #10 is to return booleans instead of using sync callbacks for every response. So for example:
// Editedvarspeaker=mpg123.create()if(!speaker){thrownewError('Could not open speaker')}
Personally I like the boolean returns more because it is easier to handle JavaScript from JavaScript. But I get the merits of the other side and I would be open to going that direction too. Let me know what you think. 😄
Edit: I forgot, in the case of mpg123.create, it would return a pointer or false, not only booleans. The same code is possible though.
Is there any way to remake
mpg123.create((success) => {})
tompg123.create((err) => {})
, with error containing the reason why not able to create?The text was updated successfully, but these errors were encountered: