diff options
author | Kevin <[email protected]> | 2024-10-11 14:57:00 -0300 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-11 14:57:00 -0300 |
commit | 7dbcef8031ddf64ccf1963f804ee4bb01849471f (patch) | |
tree | 6157ca4426e13800c79c50ff7900f2c7658fa71c /core/gjs/src/variable.ts | |
parent | 03f1a08f6e5996e5d3d7ff3952465c9c29b9f624 (diff) | |
parent | d0fb3d0434534661346bf787395e9531c97731f8 (diff) |
Merge branch 'Aylur:main' into main
Diffstat (limited to 'core/gjs/src/variable.ts')
-rw-r--r-- | core/gjs/src/variable.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/gjs/src/variable.ts b/core/gjs/src/variable.ts index 8739ef6..b61e335 100644 --- a/core/gjs/src/variable.ts +++ b/core/gjs/src/variable.ts @@ -1,6 +1,6 @@ -import Binding, { type Connectable } from "./binding.js" +import Binding, { type Connectable, type Subscribable } from "./binding.js" import { Astal } from "./imports.js" -import { interval, idle } from "./time.js" +import { interval } from "./time.js" import { execAsync, subprocess } from "./process.js" class VariableWrapper<T> extends Function { @@ -200,10 +200,9 @@ class VariableWrapper<T> extends Function { } static derive< - const Deps extends Array<Variable<any> | Binding<any>>, + const Deps extends Array<Subscribable<any>>, Args extends { - [K in keyof Deps]: Deps[K] extends Variable<infer T> - ? T : Deps[K] extends Binding<infer T> ? T : never + [K in keyof Deps]: Deps[K] extends Subscribable<infer T> ? T : never }, V = Args, >(deps: Deps, fn: (...args: Args) => V = (...args) => args as unknown as V) { @@ -225,7 +224,7 @@ export const Variable = new Proxy(VariableWrapper as any, { }) as { derive: typeof VariableWrapper["derive"] <T>(init: T): Variable<T> - new <T>(init: T): Variable<T> + new<T>(init: T): Variable<T> } export default Variable |