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
Unless configured differently, the default scope for a container is transient scope. This means that every request to the container which needs this binding will run your dynamic binding again every time it is needed in that request which can quickly become a performance bottleneck if that request is on a hot path in your application. Consider using a more cacheable scope for your dynamic bindings if possible, however any explicit scope for the binding will silence the warning.
constmodule: interfaces.ContainerModule=(bind)=>{constfactory=async()=>{awaitsleep(500);return"Hello world!";};// Will generate a warningbind(token).toDynamicValue(factory);// Will not generate a warningbind(token).inTransientScope().toDynamicValue(factory);bind(token).inRequestScope().toDynamicValue(factory);bind(token).inSingletonScope().toDynamicValue(factory);}
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
-
Unless configured differently, the default scope for a container is transient scope. This means that every request to the container which needs this binding will run your dynamic binding again every time it is needed in that request which can quickly become a performance bottleneck if that request is on a hot path in your application. Consider using a more cacheable scope for your dynamic bindings if possible, however any explicit scope for the binding will silence the warning.
Beta Was this translation helpful? Give feedback.
All reactions