Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Spread operator and proxies #39

@pkamenarsky

Description

@pkamenarsky

I have the following use case:

let st = {...};  // st is immutable

let stProxy = new Proxy(st, ...);

Now, I would like to use spread syntax to construct a new immutable version of stProxy:

let stProxy2 = {...stProxy, var: value};

However, the stProxy functionality would be lost then.

So what if {...st, ...} desugars to something like that instead:

Object.assign(st.clone ? st.clone() : {}, st, ...);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions