How to provide NgRX Signal Store in Environment Injector? #4342
dreamstar-enterprises
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I was reading this book by Manfred Steyer, and I wondered if there was a way of providing an NGRX store not at 'providedIn 'root'', but only the components that need them
Provide in Environment injector
There are provideStore, and provideEffect functions you can put inside an App Routes file, alongside Path, Component, etc., is there a provideSignalStore function too?
Why bother? Any edge cases?
Also, should I really bother? Since the sub route, and all their components are lazy loaded, and Angular says it will load the services (and I'm guessing signal stores) with them, when they are loaded (if not used elsewhere in the application)
Preloading
Another question I had is, what does provideRouter(appRoutes, withPreloading(PreloadAllModules)) do? I saw him use it throughout the examples in his book?
Thanks in advance.
Sachin
Beta Was this translation helpful? Give feedback.
All reactions