From 23b2817989e52665d66f3bb7ceaa43103bbdc90c Mon Sep 17 00:00:00 2001 From: Petter Ekrann Date: Wed, 11 Oct 2017 08:46:14 +0200 Subject: [PATCH] Ensure cloning of incomming data Please verify syntax --- src/generators/dom/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/generators/dom/index.ts b/src/generators/dom/index.ts index 8e0ec3404c..5c381b366d 100644 --- a/src/generators/dom/index.ts +++ b/src/generators/dom/index.ts @@ -190,10 +190,10 @@ export default function dom( `if (!options || (!options.target && !options._root)) throw new Error("'target' is a required option");`} @init(this, options); ${generator.usesRefs && `this.refs = {};`} - this._state = ${templateProperties.data - ? `@assign(%data(), options.data)` - : `options.data || {}`}; - ${generator.metaBindings} + + this._state =`@assign({},(%data||%noop)(),options.data)`; + + ${generator.metaBindings} ${computations.length && `this._recompute({ ${Array.from(computationDeps).map(dep => `${dep}: 1`).join(', ')} }, this._state);`} ${options.dev && Array.from(generator.expectedProperties).map(