Skip to content

Commit

Permalink
Choose getIn based off Iterable.isIterable() (#2423)
Browse files Browse the repository at this point in the history
Currently this breaks when using `Record`s or other keyed Immutable objects that aren't `Map`s or `List`s. I've tested this in the context of an app I'm working on and these changes work in my case, but haven't verified with any tests. All `Iterable`s have `getIn` so it's a very low risk change.
  • Loading branch information
dxinteractive authored and erikras committed Jan 12, 2017
1 parent e6f7ee6 commit f6e5b43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structure/immutable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const structure = {
empty: Map(),
emptyList,
getIn: (state, field) =>
Map.isMap(state) || List.isList(state) ? state.getIn(toPath(field)) : plainGetIn(state, field),
Iterable.isIterable(state) ? state.getIn(toPath(field)) : plainGetIn(state, field),
setIn,
deepEqual,
deleteIn: (state, field) => state.deleteIn(toPath(field)),
Expand Down

0 comments on commit f6e5b43

Please sign in to comment.