Skip to content

combineReducer should give warning if a reducer is not a function #3027

Closed
@baibhavx

Description

@baibhavx

Do you want to request a feature or report a bug?*

  • Feature

What is the current behavior?

  • If the object supplied to combineReducer has a key whose value is not a function, it simply ignores it.
const rootReducer = combineReducers({ 
  todos: todosReducer, 
  steps: {} // no warning, this is simply ignored 
})

What is the expected behavior?

  • It should give a warning, letting the user know that each key should point to a reducer function.

Please check out this pull-request with proposed changes: #3026

I will be more than happy to write a test case for this feature.

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