Brendan Fagan
Brendan Fagan

Reputation: 31

ngrx lazy load access to root state

I'm developing an application with ngrx that leverages lazy loaded reducers, which works fine so far.

I'm running into a scenario where I need to access both the root state and a feature state from a component in a lazy loaded module.

What would be the right approach to this?

If I have my FeatureState interface extend my RootState interface, will that give me access to the RootState objects?

OR

Do I need to inject into my Component controller both Store RootState and Store FeatureState?

Upvotes: 3

Views: 371

Answers (1)

tlt
tlt

Reputation: 15241

You just inject both into your component and use from there.

Upvotes: 1

Related Questions