Skip to content

Possibility of creating an immutable-js based polyfill? #8

Open
@nmn

Description

@nmn

One of the most common problems I run into while using 'immutable-js' is forgetting to use the .get method and instead trying to read values from a Map/Vector using a subscript.

So I end up trying to read a value from a Vector like so:

v[0]

It would be great if it was possible to create some way of using the sugar syntax with immutable values today. It's easy to use sweet-js to create sugar initialisers. Such that #[1, 2] can become Immutable.Vector(1, 2). But it is much more complex task to walk through the entire codebase, detect the value types and convert places where subscripts are being used to .get.

Perhaps a new feature for Babeljs? @sebmck thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions