From efe6956a796f99f8142e2bb8dd8cccc995dbe746 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 19 Oct 2020 09:59:56 +0200 Subject: [PATCH] support render method and value in StaticView --- src/ui/web/general/StaticView.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ui/web/general/StaticView.js b/src/ui/web/general/StaticView.js index ae4f0f98..c87a0f3c 100644 --- a/src/ui/web/general/StaticView.js +++ b/src/ui/web/general/StaticView.js @@ -18,8 +18,12 @@ limitations under the License. import {tag} from "../general/html.js"; export class StaticView { - constructor(render) { - this._root = render(tag); + constructor(value, render = undefined) { + if (typeof value === "function" && !render) { + render = value; + value = null; + } + this._root = render ? render(tag, value) : this.render(tag, value); } mount() {