From 075c7e34aa0fbdc07c86965ab5a2ae79b92d3fd3 Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 10 Oct 2024 00:13:37 +0000 Subject: core: reverse constructor props order to make stack shown property behave as expected --- core/gjs/src/astalify.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'core/gjs/src') diff --git a/core/gjs/src/astalify.ts b/core/gjs/src/astalify.ts index 29e7a5f..c4cbc5c 100644 --- a/core/gjs/src/astalify.ts +++ b/core/gjs/src/astalify.ts @@ -182,19 +182,6 @@ export default function astalify< return acc }, []) - // setup bindings handlers - for (const [prop, binding] of bindings) { - if (prop === "child" || prop === "children") { - this.connect("destroy", binding.subscribe((v: any) => { - this._setChildren(v) - })) - } - this.connect("destroy", binding.subscribe((v: any) => { - setProp(this, prop, v) - })) - setProp(this, prop, binding.get()) - } - // set children const mergedChildren = mergeBindings(children.flat(Infinity)) if (mergedChildren instanceof Binding) { @@ -220,6 +207,19 @@ export default function astalify< } } + // setup bindings handlers + for (const [prop, binding] of bindings) { + if (prop === "child" || prop === "children") { + this.connect("destroy", binding.subscribe((v: any) => { + this._setChildren(v) + })) + } + this.connect("destroy", binding.subscribe((v: any) => { + setProp(this, prop, v) + })) + setProp(this, prop, binding.get()) + } + Object.assign(this, props) setup?.(this) } -- cgit v1.2.3