Skip to content

Commit

Permalink
$mol_wire_sync fix wire sync type
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Nov 4, 2024
1 parent 3f94bae commit e0825a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wire/sync/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace $ {
* Convert asynchronous (promise-based) API to synchronous by wrapping function and method calls in a fiber.
* @see https://mol.hyoo.ru/#!section=docs/=1fcpsq_1wh0h2
*/
export function $mol_wire_sync< Host extends object >( obj: Host ) {
export function $mol_wire_sync< Host extends object & (new ( ... args: unknown[] )=> unknown) >( obj: Host ) {
return new Proxy( obj, {

get( obj, field ) {
Expand All @@ -40,7 +40,7 @@ namespace $ {
},

construct(obj, args) {
const temp = $mol_wire_task.getter(factory(obj as new ( ... args: unknown[] )=> unknown))
const temp = $mol_wire_task.getter(factory(obj))
return temp( obj, args ).sync() as object
},

Expand Down

0 comments on commit e0825a8

Please sign in to comment.