【文件属性】:
文件名称:onions:在之前或之后添加功能中间件
文件大小:71KB
文件格式:ZIP
更新时间:2021-05-23 04:07:56
javascript typescipt JavaScript
洋葱
介绍
在之前或之后添加功能中间件
安装
$ npm install onions --save
用法
import onions from 'onions' ;
const before1 = ( next ) => ( a , b ) => next ( a + 1 , b + 1 ) ;
const before2 = ( next ) => async ( a , b ) => {
await Promise . resolve ( ) ;
next ( a + 1 , b + 1 ) ;
} ;
const before3 = ( next ) => ( a , b ) => next ( a + 1 , b + 1 ) ;
const after = ( next ) => ( ... args ) => {
console . log ( 'Af
【文件预览】:
onions-master
----.eslintrc.json(322B)
----.gitignore(290B)
----.babelrc(430B)
----package.json(2KB)
----package-lock.json(278KB)
----src()
--------index.ts(1KB)
----jest.config.js(6KB)
----tsconfig.json(653B)
----README.md(934B)
----.npmignore(106B)
----test()
--------onions.test.ts(4KB)