Mobx: Mobx 4 breaking change: map.values(...).filter is not a function

Created on 16 Mar 2018  路  1Comment  路  Source: mobxjs/mobx

It seems Mobx 4 broke ObservableMap#values() and now it returns something that is no longer iterable. Is this an intented breakage?

Mobx 4: https://codesandbox.io/s/lx99xmm889
Mobx 3: https://codesandbox.io/s/nrmnqrjkq4

Most helpful comment

Definitely it is a intented breakage:

Iterating maps now follows the spec, that is, map.values(), map.entries(), map.keys(), map@@iterator and array@@iterator no longer return an array, but an iterator. Use mobx.values(map) or Array.from(map) to convert the iterators to arrays.

>All comments

Definitely it is a intented breakage:

Iterating maps now follows the spec, that is, map.values(), map.entries(), map.keys(), map@@iterator and array@@iterator no longer return an array, but an iterator. Use mobx.values(map) or Array.from(map) to convert the iterators to arrays.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mweststrate picture mweststrate  路  75Comments

fibric picture fibric  路  37Comments

bySabi picture bySabi  路  95Comments

Nopik picture Nopik  路  33Comments

sonaye picture sonaye  路  70Comments