{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/immutable-js/issues/729","repository_url":"https://api.github.com/repos/facebook/immutable-js","labels_url":"https://api.github.com/repos/facebook/immutable-js/issues/729/labels{/name}","comments_url":"https://api.github.com/repos/facebook/immutable-js/issues/729/comments","events_url":"https://api.github.com/repos/facebook/immutable-js/issues/729/events","html_url":"https://github.com/facebook/immutable-js/issues/729","id":123389271,"number":729,"title":"`deleteIn` behaves incorrectly for Map and OrderedMap ","user":{"login":"bvaughn","id":29597,"avatar_url":"https://avatars.githubusercontent.com/u/29597?v=3","gravatar_id":"","url":"https://api.github.com/users/bvaughn","html_url":"https://github.com/bvaughn","followers_url":"https://api.github.com/users/bvaughn/followers","following_url":"https://api.github.com/users/bvaughn/following{/other_user}","gists_url":"https://api.github.com/users/bvaughn/gists{/gist_id}","starred_url":"https://api.github.com/users/bvaughn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvaughn/subscriptions","organizations_url":"https://api.github.com/users/bvaughn/orgs","repos_url":"https://api.github.com/users/bvaughn/repos","events_url":"https://api.github.com/users/bvaughn/events{/privacy}","received_events_url":"https://api.github.com/users/bvaughn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-12-22T00:50:06Z","updated_at":"2016-07-01T19:50:22Z","closed_at":"2015-12-22T04:01:51Z","body":"I would expect the below 3 blocks to function the same but both `Map` and `OrderedMap` throw errors when `deleteIn` is used.\r\n\r\n```js\r\nvar fromJS = new Immutable.fromJS({ foo: { bar: 'baz' } })\r\nJSON.stringify(fromJS.toJS()) // {\"foo\":{\"bar\":\"baz\"}}\r\nJSON.stringify(fromJS.delete('foo').toJS()) // {}\r\nJSON.stringify(fromJS.deleteIn(['foo', 'bar']).toJS()) // {\"0\":{}}\r\n\r\nvar map = new Immutable.Map({ foo: { bar: 'baz' } })\r\nJSON.stringify(map.toJS()) // {\"foo\":{\"bar\":\"baz\"}}\r\nJSON.stringify(map.delete('foo').toJS()) // {}\r\nJSON.stringify(map.deleteIn(['foo', 'bar']).toJS()) // Uncaught Error: invalid keyPath\r\n\r\nvar orderedMap = new Immutable.OrderedMap({ foo: { bar: 'baz' } })\r\nJSON.stringify(orderedMap.toJS()) // {\"foo\":{\"bar\":\"baz\"}}\r\nJSON.stringify(orderedMap.delete('foo').toJS()) // {}\r\nJSON.stringify(orderedMap.deleteIn(['foo', 'bar']).toJS()) // Uncaught Error: invalid keyPath\r\n```\r\n\r\nI see one related issue #489 but it doesn't show the problem quite so clearly IMO.\r\n\r\nIn my opinion, this problem is serious enough to make use of `Map` and `OrderedMap` very questionable."},"comment":{"url":"https://api.github.com/repos/facebook/immutable-js/issues/comments/230033598","html_url":"https://github.com/facebook/immutable-js/issues/729#issuecomment-230033598","issue_url":"https://api.github.com/repos/facebook/immutable-js/issues/729","id":230033598,"user":{"login":"ffxsam","id":12532733,"avatar_url":"https://avatars.githubusercontent.com/u/12532733?v=3","gravatar_id":"","url":"https://api.github.com/users/ffxsam","html_url":"https://github.com/ffxsam","followers_url":"https://api.github.com/users/ffxsam/followers","following_url":"https://api.github.com/users/ffxsam/following{/other_user}","gists_url":"https://api.github.com/users/ffxsam/gists{/gist_id}","starred_url":"https://api.github.com/users/ffxsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffxsam/subscriptions","organizations_url":"https://api.github.com/users/ffxsam/orgs","repos_url":"https://api.github.com/users/ffxsam/repos","events_url":"https://api.github.com/users/ffxsam/events{/privacy}","received_events_url":"https://api.github.com/users/ffxsam/received_events","type":"User","site_admin":false},"created_at":"2016-07-01T19:50:22Z","updated_at":"2016-07-01T19:50:22Z","body":"I just got bit by this too. @leebyron, can you weigh in on this? Why are these two statements not the same:\r\n\r\n```js\r\nfields = Immutable.fromJS({ email: { name: 'email', failProps: { boo: true } } });\r\nfields = Immutable.Map({ email: { name: 'email', failProps: { boo: true } } });\r\n```"}}
{"actor":{"display_login":"ffxsam"}}