Skip to content

Unexpected value after chaining #41

@fdev

Description

@fdev

When chaining multiple assign/merge calls that need to change the object root, I was expecting them all to have an effect. Instead only the last assign/merge is applied.

const obj = { a: 1 }
const newObj = immutable(obj).assign(null, { b: 2 }).assign(null, { c: 3 }).value()

Expected output

{
  a: 1,
  b: 2,
  c: 3,
}

Actual output

{
  a: 1,
  c: 3,
}

If this is expected behavior it might be worth pointing it out in the documentation.

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