then / lazy-promise

A bare-bones lazily-evaluated Promises/A+ implementation.
39 stars 3 forks source link

Inherit from promise #1

Closed ForbesLindesay closed 11 years ago

ForbesLindesay commented 11 years ago

This will make pretty much all extensions to promise work with lazy promises straight away. (e.g. nodeify would work perfectly once I've updated it to use Promises@2).

P.S. awesome library

ForbesLindesay commented 11 years ago

P.S. it will require people to shim Object.create on older browsers, but that's a pretty small requirement.

edef1c commented 11 years ago

Implemented slightly differently, thanks [=

ForbesLindesay commented 11 years ago

Just worth noting, the correct way to do inheritance in JavaScript is as I demonstrated. The inherit library does a great deal of additional stuff that's unrelated. It would be much nicer and cleaner to just add those two lines, rather than a 90 line dependency that attempts to bodge classical inheritance onto a library that was never intended to support it.

edef1c commented 11 years ago

@ForbesLindesay 90 lines? https://github.com/nathan7/inherit/blob/master/index.js

ForbesLindesay commented 11 years ago

You're right, my bad. I was looking at the nom module by the same name that is a total waste of space. Your inherit is much nicer.