fx icon indicating copy to clipboard operation
fx copied to clipboard

Allow multiple annotations per function

Open sywhang opened this issue 1 year ago • 3 comments

With the new OnStart annotations being added in #895, some annotations actually might make sense for multiple annotations to take place for the same function.

For instance, the following nested annotation would allow us to specify OnStart hooks using annotations without being confusing about the order in which the hooks are executed:

fx.Annotate(
  fx.Annotate(
    func() { ... },
    fx.OnStart(...) // this hook will run first
  ),
  fx.OnStart(...) // followed by this
)

sywhang avatar Jul 20 '22 08:07 sywhang