ngxs-labs / data

NGXS Persistence API
https://ngxs-labs.github.io/data
81 stars 18 forks source link

No provider error for lazy loaded state #555

Closed vladborsh closed 4 years ago

vladborsh commented 4 years ago

In case when I have a lazy-loaded module with state data repository (used with NgxsModule.forFeature) and I want to manipulate this state directly it's ok. But when I try to manipulate it through middleware service (it has some additional logic on top of the state, for example) I stuck with the next issue

Screenshot 2020-09-25 at 10 21 07

Minimal reproduction repository https://github.com/vladborsh/ngxs-data-issue-0

Dependencies

    "@angular-ru/common": "~14.44.0",
    "@angular/animations": "~10.0.6",
    "@angular/common": "~10.0.6",
    "@angular/compiler": "~10.0.6",
    "@angular/core": "~10.0.6",
    "@angular/forms": "~10.0.6",
    "@angular/platform-browser": "~10.0.6",
    "@angular/platform-browser-dynamic": "~10.0.6",
    "@angular/router": "~10.0.6",
    "@ngxs-labs/data": "~4.1.1",
    "@ngxs/store": "~3.7.0",
    "rxjs": "~6.5.5",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.3"
vladborsh commented 4 years ago

Issue related to the dependency tree structure. It's not good practice to relate to root service in order to manipulate some lazy-loaded state