diff options
-rw-r--r-- | gjs/src/binding.ts | 7 |
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") } |