I've seen the use of setIn()
and set()
in some react-redux code:
state.setIn(...);
state.set(...);
I've found some documentation here https://facebook.github.io/immutable-js/ But unfortunately the method is not documented in detail.
I also found some other questions: Using React's immutable helper with Immutable.js But these do not answer my question.
I understand, that it must do some immutable stuff?
But what's the immutable thing here?
And what's the difference between set()
and setIn()
?
Why do we need immutable?