client receive destructurized args
This commit is contained in:
parent
aed9bf2091
commit
44602be670
@ -12,7 +12,9 @@ class Client {
|
||||
eventName: EventName,
|
||||
callback: RageFW_ClientServerCallback<EventName>,
|
||||
): void {
|
||||
rpc.register(eventName, callback as rpc.ProcedureListener)
|
||||
rpc.register(eventName, data => {
|
||||
return callback(...data)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,5 +20,5 @@ export type RageFW_ClientEventReturn<K extends RageFW_ClientEvent> =
|
||||
export type RageFW_ClientServerEvent = keyof RageFW_ICustomClientEvent
|
||||
|
||||
export type RageFW_ClientServerCallback<K extends RageFW_ClientServerEvent> = (
|
||||
args: Parameters<RageFW_ICustomClientEvent[K]>,
|
||||
...args: Parameters<RageFW_ICustomClientEvent[K]>
|
||||
) => ReturnType<RageFW_ICustomClientEvent[K]>
|
||||
|
Loading…
Reference in New Issue
Block a user