From cf9b8baf20a38816c4a060f45cb242e2f813f950 Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Tue, 11 Jul 2017 07:21:38 +0300 Subject: [PATCH] Deal with undefined values in many cases, users will want to destroy a bound value by setting it as undefined solves #79 --- app-localstorage/app-localstorage-document.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app-localstorage/app-localstorage-document.html b/app-localstorage/app-localstorage-document.html index 623b5d5..010697e 100644 --- a/app-localstorage/app-localstorage-document.html +++ b/app-localstorage/app-localstorage-document.html @@ -210,7 +210,10 @@ }, __setStorageValue: function(key, value) { - this.storage.setItem(this.key, JSON.stringify(this.data)); + if (value === undefined) { + return this.destroy(); + } + this.storage.setItem(this.key, value); } });