Does Redux Saga select
return a mutable or immutable state?
The select
operator just uses the Redux store's getState()
method internally. So, the return value from the selector function is probably going to correspond to the contents of the store state tree.
Redux itself does not actually stop you from mutating your state. It wants you to handle state immutably, but the base library does not enforce that in any way.
As a result, if your store state tree is composed of plain JS objects, then yes, the return value from select
is almost definitely going to be mutable. If your store state tree use made up of something like Immutable.js Maps and Lists, then the return value from select
will probably be immutable.