Skip to content

Bug when using methods of collectionsΒ #5

Open
@kirillrogovoy

Description

@kirillrogovoy

Hi!

I see that List's property length is proxied to become size which is the right one for Immutable.

Here's a piece of code:

const {List} = require('immutable-proxy')

const list = List([1, 2, 3])
console.log('List size: ', list.length) // 3
console.log('Filtered list size: ', list.filter(() => true).length) // undefined

You see, since all "modifying" methods return a new object, ImmutableJS creates a new one internally, which is, obviously, isn't proxied!

This bugs totally destroys a potential use of this package, unfortunately. It's just a tip of the scale, the problem exists in any collection methods which return a new object!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions