I attempted to handle various nested sets of callbacks to get the status after the API calls were complete but it truly was callback hell and required a lot of ugly, repetitive code. I think the right approach would be to use something like aio or whatever is considered the best async/await/promise library currently. As it stands, I just hacked in a 1s timer to get status after any call is made.
Also, using define-globalized-minor-mode was causing spotify-remote-mode to be called repeatedly on every switch from a buffer another buffer (or to the minibuffer). This was causing many unnecessary API calls because I had assumed the minor mode function would be called once. By specifying :global in the minor mode definition, the minor mode function is now called once for each toggle. This does prevent us from offering a buffer-specific minor mode, but that doesn't seem very useful anyway?
I attempted to handle various nested sets of callbacks to get the status after the API calls were complete but it truly was callback hell and required a lot of ugly, repetitive code. I think the right approach would be to use something like
aio
or whatever is considered the best async/await/promise library currently. As it stands, I just hacked in a 1s timer to get status after any call is made.Also, using
define-globalized-minor-mode
was causingspotify-remote-mode
to be called repeatedly on every switch from a buffer another buffer (or to the minibuffer). This was causing many unnecessary API calls because I had assumed the minor mode function would be called once. By specifying :global in the minor mode definition, the minor mode function is now called once for each toggle. This does prevent us from offering a buffer-specific minor mode, but that doesn't seem very useful anyway?