A Simple Promises AMD Module

A week or so ago I wrote a post about a simple AMD module I had created. Now I have created one more, this time a little more complex. While the latter was for a secret project, this one is (apart from also being for that project) also a part of my upcoming talk on Scaling Javascript at the Aarhus Frontend Meetup

This code is a very simple implementation of a Promise. It is in no way a full implementation of how futures/promises should work in javascript, there are many great implementations of that out there. This is however a simple working module, that I use for doing simple promise like calls when I need a callback when some long-running function has ended and returned.

I have also written a simple test of the functionality in the module. Both the module and the test has been tested with RequireJs only. This test should first show you an alert with the text "Test began", followed by a pause of one second, and then show an alert with the text "test complete".