-
Asked by @jkanywhere in #911 (comment). Please clarify, what is the designed behavior and why? https://go.dev/play/p/umSD0spuotW demonstrates that the order of fx.Invoke arguments matters: It is not obvious to me why the order should matter. Please help clarify why that is desirable. **** soft before hard **** **** hard before soft **** Program exited. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This isn't "by design" of soft value groups, but rather a limitation in Fx introduced by The order of Invokes change whether the constructors that provide the soft value group has already run or not. In your example, the "hard" running before soft will populate the soft value group dependency because the constructor that provides the soft value is forced to run. This is one of the main reasons we recommend that Invokes be used sparingly.
|
Beta Was this translation helpful? Give feedback.
This isn't "by design" of soft value groups, but rather a limitation in Fx introduced by
Invoke
.The order of Invokes change whether the constructors that provide the soft value group has already run or not. In your example, the "hard" running before soft will populate the soft value group dependency because the constructor that provides the soft value is forced to run.
This is one of the main reasons we recommend that Invokes be used sparingly.