Best practice for using multiple libraries in angular 11 #701
Replies: 1 comment
-
My team and I have written quite a large app using akita. First off though, I think you need to consider if you are asking the right question.
Now more importantly, leverage technology. Use a service worker to cache your files etc. By and large the code you write is going to be a tiny fraction of the size of the libraries and media that will be packaged with your app. So while caring about size is a good thing, a few kb extra in your module is unlikely going to be a perceivable difference.. For example, my app....
The size of the vendor chunk is nearly tripple the size of my sharedModule that cotains a boat load of stuff. Anyway just my personal opinion. |
Beta Was this translation helpful? Give feedback.
-
I'm submitting a...
Current behavior
I have two angular libraries A and B, each containing its entity models.
I would like to create two states in my Core module reflecting injectable services for A and B libraries to make them application wide services.
Given the way the akita Store and Query are constructed, this would force me to move all my models to Core module to facilitate the createInitialState() and the generic passed to the Store constructor https://datorama.github.io/akita/docs/angular/architecture.
Since my application will be large this will cause serious bloat to my Core module, and, something I don't want to do.
Is there a way for me achieve what is stated above without importing my entity model to my Core module?
Expected behavior
Minimal reproduction of the problem with instructions
For bug reports please provide the STEPS TO REPRODUCE and if possible a MINIMAL DEMO of the problem via
https://stackblitz.com or similar (you can use this template as a starting point: https://stackblitz.com/github/NetanelBasal/akita-issue-seed).
What is the motivation / use case for changing the behavior?
Environment
Angular 11
Beta Was this translation helpful? Give feedback.
All reactions