I am trying to create a simple custom promise from scratch.
For some reason, then is being executed before the onResolve function is called.
then
onResolve function