🔧 chore(app): use new createSubscription() with secureBaseBinding() to notify brightness on-screen display

This commit is contained in:
retrozinndev
2025-09-28 15:13:13 -03:00
parent 087bafb2c0
commit 3c919c9bc9
2 changed files with 18 additions and 22 deletions
+8 -1
View File
@@ -246,7 +246,7 @@ export function construct<Class extends object>(klass: Class, props: Record<any,
/** open connections to gobjects that are closed when the scope
* is disposed
* @experimental
* @experimental types don't work correctly yet
* */
export function createConnetions<
GObj extends GObject.Object,
@@ -277,6 +277,13 @@ export function createConnetions<
});
}
export function createSubscription<T = any>(accessor: Accessor<T>, callback: () => void): void {
const scope = getScope();
const unsub = accessor.subscribe(callback);
scope.onCleanup(unsub);
}
export function secureBinding<
GObj extends GObject.Object,
Prop extends keyof GObj,