I set up this project to learn how to use different kinds of async functions in JS. I use FoundryVTT, and am learning API interactions, but this project feels a little more useful to me.
I am still learning how to start projects using webpack and npm, so I am also trying to work those muscles and build good development habits starting at the first steps of a project. It's getting faster!
I have 3 goals for this:
- Use callback functions to pass dicerolls with a timeout function imitating externally-sourced API calls
- Convert all the logic to use
new Promise
and.then()
- Convert all the logic to use
async function
andawait
The UI is pretty basic, loaded in a couple of character avatars and gave them random statistics.
The program is hosted on the gh-pages branch. Main includes working changes at each interrval of development. There is a branch for each "feature" I am working on before merging to main. There will be branched for dice-logic in general, a callback-hell branch, promise branch, and async-await branch.