File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
packages/ioc/src/middleware Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
1111 poolContainer ,
1212 isBoolean ,
1313} from '@kever/shared'
14- import { middlewarePatchPool } from './patch'
14+ import { middlewarePatchContainer } from './patch'
1515import { isPromise } from '../utils'
1616
1717export const middlewareGlobalContainer = Object . create ( { } )
@@ -138,7 +138,7 @@ export const destoryAllMiddleware = () => {
138138export const Middleware =
139139 ( tag : Tag , type : MType ) : ClassDecorator =>
140140 ( target ) => {
141- const middlewareOptions = middlewarePatchPool . use ( tag )
141+ const middlewareOptions = middlewarePatchContainer . use ( tag )
142142 const parameter : unknown [ ] = [ ]
143143 if ( middlewareOptions ) {
144144 parameter . push ( middlewareOptions )
Original file line number Diff line number Diff line change 1- import { InstancePool } from '../instancePool'
2- import { Tag } from '../utils/types'
1+ import { Tag , Container } from '@kever/shared'
32
43type Payload = ( ( ) => unknown ) | string | number | symbol | any [ ] | object
54type PayloadExcludeFn = Exclude < Payload , ( ) => unknown >
65
7- export const middlewarePatchPool = new InstancePool < Tag , PayloadExcludeFn > ( )
6+ export const middlewarePatchContainer = new Container < Tag , PayloadExcludeFn > ( )
87
98export const middlewarePatch = ( tag : Tag , payload : Payload ) => {
109 let option : PayloadExcludeFn
@@ -13,5 +12,5 @@ export const middlewarePatch = (tag: Tag, payload: Payload) => {
1312 } else {
1413 option = payload
1514 }
16- middlewarePatchPool . bind ( tag , option )
15+ middlewarePatchContainer . bind ( tag , option )
1716}
You can’t perform that action at this time.
0 commit comments