Comments (2)
Your solution is how we would recommend going about this. We thought long and hard about whether or not we should scope instances of Store
to feature state and ultimately came to the conclusion that - while powerful - it can be very confusing to track what instances of Store
are received by which components. It also complicates deriving state from multiple features, a pattern that is common in our own applications.
from platform.
The current way I'm doing this
const ROOT_STORE = new InjectionToken<Store<MyAppState>>('rootStore');
in root module:
{provide: ROOT_STORE, useExisting: Store}
in child module:
{ provide: Store, useFactory: (store: Store<MyAppState>) => store.select(createFeatureSelector<MyFeatureState>('myFeature')), deps: [ROOT_STORE] }
(we refer to MyAppState
and ROOT_STORE
in child module for type safety, but could skip this and use string as a type token if we want complete separation)
from platform.
Related Issues (20)
- @ngrx/signals: Add documentation for Entity Management HOT 1
- @ngrx/signals: aucompletion on signalStore with signalStoreFeature is not working HOT 2
- @ngrx/store Migration from v2 to v4+ HOT 1
- Add ESLint Plugin rule for createSelector usages with over 8 inputs HOT 2
- ngrxLet does not seem to support dictionaries of observables as stated in the documentation HOT 3
- @ngrx/avoid-cyclic-effects is triggered in takeUntil(merge()) operator HOT 2
- NGRX polling with Entity (State updates even when data hasn't changed) HOT 1
- Codespaces container not building
- Global Level Signal Store incorrect file names
- Signal store and signal state should have something like connectSignal and connectObservable to connect streams/signals to state HOT 2
- @ngrx/signals: ability to use method inside rxMethod HOT 2
- The signalStore function could return two functions, one for provide and one for inject. HOT 1
- Router Navigate does not update router state data. selectRouteData returns {} HOT 3
- Missing git tag for 17.0.1 HOT 1
- Firebase ngrx by freezing firebase-cdk HOT 1
- @ngrx/signals: Extension Point stateChange HOT 1
- signalStoreFeature: inject(MatDialog) not possible HOT 3
- on() with union type causes ts2322 HOT 3
- provide injection context to `onDestroy` HOT 8
- @ngrx/signals: add `deepComputed` function HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from platform.