Bug: ofType doesn't work
See original GitHub issueVersions:
- ts-action@11.0.0
- ts-action-operators@9.1.1
I have a scenario:
import { action, props } from 'ts-action';
import { ofType } from 'ts-action-operators';
export const authorized = action(
'[Auth Epic] authorized',
props<{ user: User; token: string }>(),
);
const authorizedEpic = (action$, state$) =>
action$.pipe(
ofType(authorized),
distinctUntilChanged((a, b) => a.token === b.token),
...
);
Complier complains: Property 'token' does not exist on type '{}'.
.
I have previously worked with NgRx and had no issues like that. Is there something I am doing wrong or is ofType
operator broken?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Ngrx store getting error as Property 'ofType' does not exist on ...
ERROR in src/app/store/effects/authentication.effects.ts(25,7): error TS2339: Property 'ofType' does not exist on type 'Actions<Action>'. src/ ...
Read more >Bug(@ngrx/Effect): Cannot read property 'ofType' of undefined ...
I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [X] Bug report [...
Read more >Troubleshooting - redux-observable
When you're using ofType operator for filtering, returned observable won't be correctly narrowed within Type System, because its not capable of doing so...
Read more >Solved: Re: Problem with a field of type URL (bug?) - Google Cloud ...
Hi, I've got a problem with a calculated field (type url) in one of my apps. As you can see here, I compose...
Read more >Why do I get an "Error using eval: Undefined function ...
1) First, locate your pathdef.m file. · 2) If the above does not resolve the issue then your pathdef.m file may be corrupted...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The inference fails because
pipe
is called onany
- not onObservable
- so it cannot match thepipe
method onObservable
. That means there is no relationship between the arguments passed topipe
, so the output ofofType
has no affect ondistinctUntilChanged
. Whenaction$
is typed correctly, apipe
signature is matched and the inference flows as you’d expect it to.Ok, I did not consider the problem was on the pipe level, thanks 😃