@jswork/next-compose

Compose for next.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@jswork/next-compose
1.1.210 months ago2 years agoMinified + gzip package size for @jswork/next-compose in KB

Readme

next-compose
Compose for next.

!versionversion-imageversion-url !licenselicense-imagelicense-url !sizesize-imagesize-url !downloaddownload-imagedownload-url

installation

npm install -S @jswork/next-compose

usage

import '@jswork/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');  // fn1(fn2(fn3('afei')));
// {@AFEI}

const rs2 = cp2('afei'); // fn3(fn2(fn1('afei')));
// @{AFEI}

license

Code released under the MIT license.