Skip to main content

New answers tagged

2 votes

How to prevent init functions from running on all services in Encore.ts

This is expected behavior due to how Encore.ts bundles JavaScript - all service code is included in a single bundle, even though each container only hosts one service. To run initialization code ...
KMorris's user avatar
  • 41
2 votes

How to prevent init functions from running on all services in Encore.ts

Could use lazy initialization (The Singleton Pattern) Avoid "eager" initialization at the top level of your files. Instead, use a function or a getter that initializes the resource only the ...
Max's user avatar
  • 1,088

Top 50 recent answers are included