gajus / gajus/redux-immutable

Wrong return type of combineReducers

Open
#74 10 comments 8 reactions 0 assignees View on GitHub
question
Dominant language
TypeScript
Stars
1.9k
Forks
84
PR merge metrics
No merged PRs in 30d

Description

Hello,

I am using `redux-immutable` with `TypeScript` and found this issue.

The `combineReducer` (provided by `redux-immutable`) returns a plain object instead of `Immutable.Collection`.

Such typing force me to do `state.sidebar` instead of `state.get('sidebar')` in `mapStateToProps`.

```javascript
const mapStateToProps = (state: StateType) => ({
sidebar: state.get('sidebar'), // <- this is correct example of usage
})
```

Screen Shot 2019-05-04 at 4 51 19 AM

Screen Shot 2019-05-04 at 2 07 41 PM

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the combineReducer entry point and inspect its TypeScript return type. Reproduce the reported mapStateToProps usage, then verify that the combined state is typed as an Immutable collection and that state.get('sidebar') type-checks correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.