Skip to content

Support Typescript 2.4.x #17

Closed
Closed
@SethDavenport

Description

@SethDavenport

This is a...

  • feature request
  • bug report
  • usage question

What toolchain are you using for transpilation/bundling?

  • @angular/cli
  • Custom @ngTools/webpack
  • Raw ngc
  • SystemJS
  • Rollup
  • Other

Environment

NodeJS Version:
Typescript Version:
Angular Version:
@angular-redux/store version:
@angular/cli version: (if applicable)
OS:

Link to repo showing the issus

(optional, but helps a lot)

Expected Behaviour:

This should work fine (it does in typescript < 2.4)

import { routerReducer } from '@angular-redux/router';

export const rootReducer = composeReducers(
  combineReducers({
    // ... etc.
    router: routerReducer,
  }));

Actual Behaviour:

You get a TSC error (below).

Stack Trace/Error Message:

ERROR in /Users/sdavenport/code/angular-redux/example-app/src/app/store/reducers.ts (12,19): Argument of type '{ router: routerReducer...' is not assignable to parameter of type 'ReducersMapObject'.
  Property 'router' is incompatible with index signature.
    Type '(state: string, action: RouterAction) => string' is not assignable to type 'Reducer<any>'.
      Types of parameters 'action' and 'action' are incompatible.
        Type 'A' is not assignable to type 'RouterAction'.
          Type 'Action' is not assignable to type 'RouterAction'.
            Property 'payload' is missing in type 'Action'.

Additional Notes:

(optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions