Yapawapa
Yapawapa is a decorator of Yapa promises. It makes it easy to add arbitrary functions to the prototype of a Yapa promise constructor. Those functions can then seamlessly be used within a promise chain.
Installation
Download
$ npm install yapawapa
Require
var yapawapa = ;
API
yapawapa.decorate(decorations)
Returns a promise constructor whose prototype has been decorated with decorations
. Functions found in decorations
will be wrapped so that they can be used seamlessly in a promise chain. Getters and setters in decorations
will be wrapped so that they are called on the underlying context of the promise instance.
Promise(context)
The promise constructor generated by decorate
. All functions that were added through decorate
will be called in the context of context
. All getters and setters will be read/write-throughs to the matching properties of context
.
Example
var Promise = yapawapa; var promise = Promise name: 'yapawapa' ; assert; promise; promise;
Testing
$ cd yapawapa
$ npm test
Issues
Found a bug? Create an issue on GitHub.
https://github.com/jharding/yapawapa/issues
Versioning
For transparency and insight into the release cycle, releases will be numbered with the follow format:
<major>.<minor>.<patch>
And constructed with the following guidelines:
- Breaking backwards compatibility bumps the major
- New additions without breaking backwards compatibility bumps the minor
- Bug fixes and misc changes bump the patch
For more information on semantic versioning, please visit http://semver.org/.
License
Copyright (c) 2013 Jake Harding
Licensed under the MIT License.