🌀
type-chef-di Docs
GitHub
  • 👋Welcome to type-chef-di documentation
  • Overview
    • ✨Getting started
  • Fundamentals
    • 🍎Container Options, extendability
    • 👨‍🍳Injection
      • 🍕Type injection
      • 🍪Token registration
      • ☕Token Injection
      • 🌮Mixed injection
    • 🛠️Decorators
      • ✅@Injectable({instantiation: "singleton" | "prototype"})
      • 🎯@Inject<T>(key: string | Type<T>)
      • 🍍@InjectProperty<T>(key: string | Type<T>)
      • 🍭@Setter()
      • 🔆@InitMethod()
      • 🏭@FactoryMethod()
      • ⚡@AddTags(tags)
      • 🪃@RunBefore(key: string | Type<IRunBefore>)
      • 🛴@RunAfter(key: string | Type<IRunAfter>)
      • 🌕@MethodWrapper(key: string | Type<IMethodWrapper>)
  • Use Cases
    • 🎨Plans
    • 🖥️For Developers
  • Other
    • 💡DI / IoC
Powered by GitBook
On this page
Edit on GitHub
  1. Fundamentals
  2. Decorators

@RunAfter(key: string | Type<IRunAfter>)

 class MyRunAfter implements IRunAfter {
      constructor() { // DI will resolve dependencies (type & key injection)
    }
    
    run() {
        console.log('run this after.')
    }
}

class Test {

    @RunAfter(MyRunAfter)  // or use registerd string key
    after(p1:string, p2: string){
        console.log("original fn: ", p1, p2)
            // ...
    }
        
}
  
}
Previous@RunBefore(key: string | Type<IRunBefore>)Next@MethodWrapper(key: string | Type<IMethodWrapper>)

Last updated 2 years ago

🛠️
🛴