gajus / redux-immutable

redux-immutable is used to create an equivalent function of Redux combineReducers that works with Immutable.js state.
Other
1.88k stars 82 forks source link

Allow storing state as a Record #46

Closed SvenC81 closed 7 years ago

SvenC81 commented 7 years ago

Is there a particular reason you define your state as a Map?

Usually you know the state structure beforehand and it's not dynamic in any way plus it would make it easier to access the state (instead of using get).

The only downside I can see is that you need to create a predefined StateRecord containing all the state properties beforehand which you would pass to combineReducers. Each time you add a reducer you need to update this record.

Any thoughts?

artola commented 7 years ago

I do believe the record could be a nice solution to make it easier with redux-react-router.

gajus commented 7 years ago

@SvenClauw I don't see a particular reason why this couldn't be done.

Would you like to raise a PR?

It would involve:

reimertz commented 7 years ago

I would be interested in helping out with this to learn more about Immutable.js.

Could you give me some help where to start and what I might need to know inorder to help out?

paynecodes commented 7 years ago

Heads up!

When using Immutable v4.0.0-rc.2, the following check fails when using an Immutable.Record as default state.

if (!Immutable.Iterable.isIterable(state))