reselect
reselect copied to clipboard
A mistake in README
In the section "How do I use Reselect with Immutable.js?",there is a mistake in the sample code:
import Immutable from 'immutable'
let myMap = Immutable.Map({
a: 1,
b: 2,
c: 3
})
// set, merge and others only return a new obj when update changes collection
let newMap = myMap.set('a', 1)
assert.equal(myMap, newMap)
newMap = myMap.merge({ 'a', 1 }) // **mistake occured, should be `newMap = myMap.merge({ 'a': 1 }) ` **
assert.equal(myMap, newMap)
// map, reduce, filter and others always return a new obj
newMap = myMap.map(a => a * 1)
assert.notEqual(myMap, newMap)
Thank you, fixed.