# clone with immer syntax for immutable updates

**URL:** <https://es.discourse.group/t/clone-with-immer-syntax-for-immutable-updates/86>\
**Category:** 💡 Ideas\
**Created:** [July 24, 2019, 11:50pm UTC](https://es.discourse.group/t/clone-with-immer-syntax-for-immutable-updates/86 "2019-07-24T23:50:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfpiccolo](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/mfpiccolo/32/107_2.png) [@mfpiccolo](https://es.discourse.group/u/mfpiccolo)\
**Post date:** [July 24, 2019, 11:50pm UTC](https://es.discourse.group/t/clone-with-immer-syntax-for-immutable-updates/86/1 "2019-07-24T23:50:16Z")

</div>

I thew together a quick proposal here: [https://github.com/mfpiccolo/proposal-clone](https://github.com/mfpiccolo/proposal-clone)

Wanted to see if anyone is interested in this.

---

<div class="post-metadata">

**Author:** ![devsnek](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/devsnek/32/100_2.png) [@devsnek](https://es.discourse.group/u/devsnek)\
**Post date:** [July 25, 2019, 3:06am UTC](https://es.discourse.group/t/clone-with-immer-syntax-for-immutable-updates/86/2 "2019-07-25T03:06:19Z")

</div>

Unlike the previous times this has been brought up, engines now have efficient cloning APIs thanks to structured cloning in browsers. I'm not sure if that was the only blocker, but that gets rid of one.

One note: you should probably `Object.clone`, we do not ever add properties to `Object.prototype`.

---

<div class="post-metadata">

**Author:** ![mfpiccolo](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/mfpiccolo/32/107_2.png) [@mfpiccolo](https://es.discourse.group/u/mfpiccolo)\
**Post date:** [July 25, 2019, 3:49am UTC](https://es.discourse.group/t/clone-with-immer-syntax-for-immutable-updates/86/3 "2019-07-25T03:49:39Z")

</div>

Got it. I updated to use `Object.clone`. I wasn't sure how stuctured clone would play into this. Glad to hear a blocker is out of the way.
