This is just a simple, zero dependency, vanilla JavaScript, 100% compatible with all browsers and straight forward compose of functions.
MIT License
This is just a simple, zero dependency, vanilla JavaScript, 100% compatible with all browsers and straight forward compose of functions.
Here's why this exists:
Vanilla Javascript and nothing more.
npm install simple-compose
or
yarn add simple-compose
import { compose } from 'simple-compose';
/* Your code */
export default compose(fn1, fn2, fn3, fn4, fn5, fn6, ..... f284)(mySimpleFunc)
In case you need. The function that is returned by the compose
function, can accept as many params as you want but the subsequence function doesn't. Those functions just accept only one param, which is the param that the last function returned. See the examples below:
function fn1(param1, param2, param3) {
/** Implementation */
}
function fn2(param1, param2, param3) {
/** Implementation */
}
compose(fn1, fn2)('foo', 'bar', 'xar');
function fn1(param) {
/** Implementation */
}
function fn2(param1, param2, param3) {
/** Implementation */
}
compose(fn1, fn2)('foo', 'bar', 'xar');
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE
for more information.
Emmanuel Kant Duarte - @emmanuelkantf - [email protected]
Project Link: https://github.com/emmanuelkant/simple-compose