Closed marcpearson closed 5 months ago
Hi @marcpearson,
You can explicitly pass void
as generic type in such cases. As you can see in this demo here: https://github.com/spierala/mini-rx-store/blob/master/apps/mini-rx-angular-demo/src/app/modules/todos/state/todos-store.service.ts#L107
Did you maybe update from mini-rx-store 3.x ? There was a breaking change for FeatureStore.effect in 4.0:
See the CHANGELOG here: https://github.com/spierala/mini-rx-store/blob/master/libs/mini-rx-store/CHANGELOG.md
I will further investigate in the coming days. Ideally the generic type should not be necessary if there is no argument for the effect.
Thanks for your help. I greatly appreciate it. After passing void
my code compile again. But like you said we should not need to pass a generic if no argument for the effect
I will close this issue.
RxJS Subject
has the same behavior... it requires an explicit void
as generic type.
With explicit void
:
Since this behavior is known from RxJS Subject, I do not see it as a real issue in MiniRx effect
.
When using effect that don't require an argument ( like loadTodos() is your documentation). Typescript complain about missing argument (observableOrValue: unknown) => void
feature-store.d.ts in line 15 =====> (observableOrValue: ObservableType | Observable) => void> the argument is not optional
Angular 15 "mini-rx-store": "^4.1.0", "mini-rx-store-ng": "^3.0.0", "typescript": "4.8.4",