batmanjs/batman — pull request #1099 by rmosolgo (2014-07-23 15:28:17+00:00)
Title: Batman.Promise

I want to add Promises to batman.js.

(So far, I'm implementing Batman.Promise. I haven't applied it anywhere yet. Don't worry I'll yank out the `console.log`s once I don't need them anymore :P)

At first, I was shopping around to the different promise libraries, thinking we would need a "platform adapter"-type solution. But then I read the ["implementing"](https://www.promisejs.org/implementing/) page from Promises/A+. It seemed pretty easy actually, so I figured why not just but an implementation in batman.js?

I aimed to match the ES6 Spec as closely as possible. Maybe someday you could just do

```coffeescript
if window.Promise?
Batman.Promise = window.Promise
```

And delegate to the native implementation.