TI-84 Emulator

Judging by the fact that you said you were dealing with promises, I can show you how to do it in snap.

Basically you need to return a list containing functions that get a javascript variable that is used to determine if it's done, if it's successful, and the value you're getting. Of course you can set the result variable anywhere, it just needs to be set before done and successful (successful should be set before done).

The myPromise variable in this example is just an example, it can be any promise. I did put some console.log()s in here, which those can be removed.