quasi unhook test
This commit is contained in:
+2
-3
@@ -17,8 +17,8 @@ export class RPCSocket implements I.Socket{
|
||||
Object.defineProperty(this, 'socket', {value: undefined, writable: true})
|
||||
}
|
||||
|
||||
public hook(name: T.Name, args: T.Arg){
|
||||
return this.socket.hook(name, args)
|
||||
public hook(name: T.Name, handler: (...args:any[]) => any | Promise<any>){
|
||||
return this.socket.hook(name, handler)
|
||||
}
|
||||
|
||||
public unhook(name: T.Name){
|
||||
@@ -47,7 +47,6 @@ export class RPCSocket implements I.Socket{
|
||||
|
||||
public async connect(){
|
||||
this.socket = await bsock.connect(this.port, this.server, this.tls)
|
||||
this.on('error', () => {})
|
||||
|
||||
const info:T.ExtendedRpcInfo[] = await this.info()
|
||||
info.forEach(i => {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ export interface Exporter<T = {}>{
|
||||
|
||||
export interface Socket extends Destroyable {
|
||||
port: number
|
||||
hook: (rpcname: T.Name, ...args: T.Any[]) => I.Socket
|
||||
hook: (rpcname: T.Name, handler: (...args:any[]) => any | Promise<any>) => I.Socket
|
||||
unhook: (rpcname:T.Name) => I.Socket
|
||||
call: (rpcname:T.Name, ...args: T.Any[]) => Promise<T.Any>
|
||||
fire: (rpcname:T.Name, ...args: T.Any[]) => Promise<T.Any>
|
||||
|
||||
Reference in New Issue
Block a user