Isn't fn.assign useless inside getState?
Open
- Dominant language
- JavaScript
- Stars
- 3.4k
- Forks
- 312
- PR merge metrics
- No merged PRs in 30d
Description
In my application I call getState so frequently that it even affects performance. I started to investigate and and came across `fn.assign` here:
```js
getState(state) {
if (Array.isArray(state)) {
return state.slice()
} else if (fn.isMutableObject(state)) {
return fn.assign({}, state)
}
return state
}
```
To my mind it's absolutely useless as it does only shallow copy which means inner mutable objects will still be mutable after assigning. Seems that this code just ... slows down performance?
Contributor guide
Assessment
This issue has not been assessed yet.