reselect icon indicating copy to clipboard operation
reselect copied to clipboard

A mistake in README

Open xuchaobei opened this issue 9 years ago • 1 comments

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)

xuchaobei avatar Nov 06 '17 10:11 xuchaobei

Thank you, fixed.

ellbee avatar Nov 22 '17 19:11 ellbee