summaryrefslogtreecommitdiff
path: root/gjs/src
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-06-15 23:33:47 +0200
committerAylur <[email protected]>2024-06-15 23:33:47 +0200
commita4229d6db2896a9e600ec7110c0370d50f2fb73c (patch)
treed06a816b5dd76a880956262c318f13fb56874ca8 /gjs/src
parent183e68d68c3cbc264a9e94339af3ff7982acd3cc (diff)
fix(gjs): property getter in binding
Diffstat (limited to 'gjs/src')
-rw-r--r--gjs/src/binding.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/gjs/src/binding.ts b/gjs/src/binding.ts
index 50d941d..af92e78 100644
--- a/gjs/src/binding.ts
+++ b/gjs/src/binding.ts
@@ -52,8 +52,13 @@ export default class Binding<Value> {
if (typeof this.emitter.get === "function")
return this.transformFn(this.emitter.get())
- if (typeof this.prop === "string")
+ if (typeof this.prop === "string") {
+ const getter = `get_${snakeify(this.prop)}`
+ if (typeof this.emitter[getter] === "function")
+ return this.transformFn(this.emitter[getter]())
+
return this.transformFn(this.emitter[this.prop])
+ }
throw Error("can not get value of binding")
}