Skip to content

Commit d3d6713

Browse files
committed
fix: use public API to register runtime handlers
1 parent 0d7d699 commit d3d6713

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

packages/core/src/bridge/index.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@ export class FrpBridge {
109109
...(options.queries ?? {})
110110
}
111111

112-
// Update runtime with handlers
113-
// @ts-expect-error - Setting private property for handler registration
114-
this.runtime.commands = commands
115-
// @ts-expect-error - Setting private property for handler registration
116-
this.runtime.queries = queries
112+
// Register handlers in runtime
113+
Object.entries(commands).forEach(([name, handler]) => {
114+
this.runtime.registerCommand(name, handler)
115+
})
116+
Object.entries(queries).forEach(([name, handler]) => {
117+
this.runtime.registerQuery(name, handler)
118+
})
117119

118120
this.eventSink = options.eventSink
119121
setupProcessEventBridge(this.process, this.eventSink)

0 commit comments

Comments
 (0)