immutable-js-oss / immutable-js

Immutable persistent data collections for Javascript which increase efficiency and simplicity.
https://immutable-js-oss.github.io/immutable-js/
MIT License
37 stars 6 forks source link

Map and Set are not converted to Immutable.Map and Immutable.Set via Immutable.fromJS() #146

Open Methuselah96 opened 4 years ago

Methuselah96 commented 4 years ago

From @marinovich on Thu, 11 Jul 2019 08:01:01 GMT

What happened

There is no way to create Immutable.Map and Immutable.Set from Map and Set via Immutable.fromJS()

How to reproduce

const set = new Set([1, 2, 3]);
const immutableSet = Immutable.fromJS(set);

console.log(set === immutableSet) // true

And the same with Map

Copied from original issue: https://github.com/immutable-js/immutable-js/issues/1723