Skip to content

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

Closed
@seritools

Description

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:

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions