Hi I am using NGXS state managment library in my App and I have selector like below and everything is working fine but when I am testing my app I have got error like below. PrintItemsState is lazy loadad. What I noticed problem is that im passing PrintItemsState as argument here.
@Selector([PrintItemsState])
but i have no clue how to fix it. I will be graceful for any suggestions.
print-items.selectors.ts
@Injectable()
export class PrintItemsSelectors {
...
@Selector([PrintItemsState])
static filter(state: PrintItemsStateModel): KeyValue<string, string>[] {
const filters = state.fabricPage.page.Filter;
const filterKeys = Object.keys(state.fabricPage.page.Filter);
const activeFilters = [];
filterKeys.forEach((key) => {
if (filters[key]) {
activeFilters.push({key: [key], value: filters[key]});
}
});
return activeFilters;
}
...
}
print-items.module.ts
@NgModule({
declarations: [
PrintItemsListComponent,
FabricTableComponent,
SummaryTableComponent,
RollCodeDialogComponent,
CommentDialogComponent
],
imports: [
PrintItemsRoutingModule,
SharedModule,
NgxsModule.forFeature([PrintItemsState])
],
providers: [
PrintItemsHttpService
]
})
export class PrintItemsModule {
}
Unfortunatelly I still havent`t solved my problem. I have posted question on their github but without answer. I found simillar issue but I am using NGXS 3.7.2 so it shouldnt be a case. Temporary solution is that I moved selectors inside state class.