UNPKG
@ng1005/chrome-extension-common
Version:
latest (0.0.6)
0.0.6
0.0.5
0.0.3
0.0.2
0.0.1
chrome扩展通用库--消息与storage
@ng1005/chrome-extension-common
/
src
/
types
/
InterceptorsManager.ts
12 lines
(11 loc)
•
314 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
{
Interceptor
}
from
"./Interceptor"
;
// 拦截器管理器,只用来保存拦截器的队列
export
default
class
InterceptorsManager
{
handlers
:
Array
<
Interceptor
>
constructor
(
) {
this
.
handlers
= []; }
use
(
fulfilled
:
any
,
rejected
:
any
) {
this
.
handlers
.
push
({ fulfilled, rejected }); } }