You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The answer is No, the order in which you provide Fx options to fx.Options, fx.New, fx.Module, and others does not matter.
However, later is this
Consuming values: Operations like fx.Invoke and fx.Populate are run after their dependencies have been satisfied: after fx.Provides.
Relative to each other, invokes are run in the order they were specified.
So suddenly order matters. And what is more important, if I have Invoke inside Modules which are all passed via fx.New(). Then order in fx.New matters not for Provide, but for Invoke.
Simple example. Where enqeue is made from worker. So Provide is called always to satisfy dependencies.
However order really matters regarding which StopHook will be called first.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
In https://uber-go.github.io/fx/faq.html, the first question is Does the order of fx.Options matter?
The answer is No, the order in which you provide Fx options to fx.Options, fx.New, fx.Module, and others does not matter.
However, later is this
So suddenly order matters. And what is more important, if I have
InvokeinsideModules which are all passed viafx.New(). Then order infx.Newmatters not for Provide, but for Invoke.Simple example. Where enqeue is made from worker. So
Provideis called always to satisfy dependencies.However order really matters regarding which StopHook will be called first.
Should documentation be changed?
All reactions