next-compose
Compose for next.
installation
npm install -S @feizheng/next-compose
usage
import '@feizheng/next-compose';
const fn1 = function (inStr) {
return inStr.toUpperCase();
};
const fn2 = function (inStr) {
return ['{', inStr, '}'].join('');
};
const fn3 = function (inStr){
return '@' + inStr;
}
const cp = nx.compose(fn1, fn2, fn3);
const cp2 = nx.compose(fn3, fn2, fn1);
const rs = cp('afei');
// @{AFEI}
const rs2 = cp2('afei');
// {@AFEI}
license
Code released under the MIT license.