0
비동기 함수 # 1을 비동기 함수 # 2로 장식하려고합니다.Typescript, 비동기 함수를 장식하십시오.
예.
function func2(param) {
return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {
//make async operations and then return descriptor
}
@func2(param)
async function func1() {
await .... //some async operation
await .... //some async operation
}
그래서, 주요 아이디어는 장식의 일부 비동기 작업을 수행하고 주요 기능의 다른 비동기 호출을 수행하는 것입니다.
타이코크 데코레이터를 만들 수 있습니까?
미리 감사드립니다. 그 한 가지 제한하므로