Skip to content

Clone default objects #415

@justinbmeyer

Description

@justinbmeyer

I would like to be able to do:

DefineMap.extend({
  items: {default: []},
  data: {default: {foo: "bar"}}
})

And have it clone the default object/array. This would no longer warn because the value would be copied. This would be a breaking change.

I'd also like to be able to do:

DefineMap.extend({
  items: {default: []}
  data: {foo: "bar"}
})

And have it do the same thing. However, this would be another breaking change.

Other considerations:

  • what happens if something like window is passed? We can't clone that. We only clone POJO objects?
  • Do we clone objects deep?

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