https://github.com/raineorshine/sweet-compose
Sweet js macro for function composition
https://github.com/raineorshine/sweet-compose
Last synced: 3 months ago
JSON representation
Sweet js macro for function composition
- Host: GitHub
- URL: https://github.com/raineorshine/sweet-compose
- Owner: raineorshine
- License: isc
- Created: 2015-05-17T04:00:46.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-27T05:54:46.000Z (about 10 years ago)
- Last Synced: 2025-03-10T15:09:33.160Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 145 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sweet-compose
[](http://badge.fury.io/js/sweet-compose)> Sweet js macro for function composition
## Usage
```sh
$ npm install --save sweet-compose
$ sjs -m sweet-compose myfile.js
``````js
var assert = require('chai').assertit('should compose two functions', function() {
function add1(x) { return x+1; }
function double(x) { return x*2; }
assert.equal((double +. add1)(2), 6)
})it('should sequence two functions', function() {
function add1(x) { return x+1; }
function double(x) { return x*2; }
assert.equal((double +| add1)(2), 5)
})
```## License
ISC © [Raine Lourie](https://github.com/metaraine)