How would one get the buttons variable out of the success function from the example above. I assume this is a type of promise as I can read it inside the function but if I try to save it to an external variable it comes out empty.
I lied a bit, I was using the flic plugin as an example but I am actually developing a plugin for the flic 2 which works similarly to the one I mentioned. It works I just can’t figure out how to get data out of the darn promises.
You can’t. That’s the point. At the bottom of all of it, you’re still really providing a callback, and only in the callback is the data available. Return the Promise, and hang a then off it in the ultimate caller.