Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ofType pipable operator does not work with tsconfig "strict": true #753

Closed
seritools opened this issue Jan 25, 2018 · 2 comments
Closed

Comments

@seritools
Copy link

seritools commented Jan 25, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request

What is the current behavior?

Typescript throws the following error using ofType in a pipe when working in strict mode:

Argument of type '(source$: Actions<Action>) => Actions<Action>' is not assignable to parameter of type 'UnaryFunction<Observable<Action>, Observable<Action>>'. Types of parameters 'source$' and 'source' are incompatible. Type 'Observable<Action>' is not assignable to type 'Actions<Action>'. Property 'ofType' is missing in type 'Observable<Action>'.

Since typescript still compiles with these errors, the resulting javascript still works fine.

Expected behavior:

No error.

Minimal reproduction of the problem with instructions:

The sample in the docs exhibits this problem.

Version of affected browser(s),operating system(s), npm, node and ngrx:

Angular CLI: 1.6.5
Node: 9.3.0
OS: win32 x64
Angular: 5.2.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.1.0
@angular/cli: 1.6.5
@angular/material: 5.1.0
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.5
@schematics/angular: 0.1.17
typescript: 2.6.2
webpack: 3.10.0

ngrx v5.0.0, v5.0.1

Other information:

@abdulhaq-e
Copy link

I confirm. I'm not sure but I thing it's because of TS 2.6.2, the library needs to adapt to the strict checking introudiced in the new version.

@sandangel
Copy link
Contributor

you can implement a custom ofType operator as described in this: #709 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants