From e7b902599c4da6cbdbe7c77fa0cbefc63616903e Mon Sep 17 00:00:00 2001 From: Christopher Mardell Date: Wed, 5 Aug 2020 20:07:57 +0930 Subject: [PATCH] Use is_empty --- src/runtime/internal/Component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/internal/Component.ts b/src/runtime/internal/Component.ts index fbe9de1680..489623ac0d 100644 --- a/src/runtime/internal/Component.ts +++ b/src/runtime/internal/Component.ts @@ -181,14 +181,14 @@ if (typeof HTMLElement === 'function') { connectedCallback() { if (!this.$$) { // wasn't set up from constructor as options were not ready - const options = Object.keys(this.$$initialProps).length ? + const options = is_empty(this.$$initialProps) ? + null: { props: this.$$initialProps - } : - null; + }; this.$$setup(options); - // clean up + // clean up, prevent reuse of $$initialProps this.$$initialProps = null; } // @ts-ignore todo: improve typings