Home > post-me > RemoteHandle > setCallTransfer
Specify which parts of the arguments of a given method call should be transferred into the other context instead of cloned.
Signature:
setCallTransfer<K extends keyof M>(methodName: K, transfer: (...args: Parameters<M[K]>) => Transferable[]): void;
Parameter | Type | Description |
---|---|---|
methodName | K | The name of the method |
transfer | (…args: Parameters<M[K]>) => Transferable[] | A function that takes as parameters the arguments of a method call, and returns a list of transferable objects. |
Returns:
void
You only need to call setCallTransfer once per method. After the transfer function is set, it will automatically be used by all subsequent calls to the specified method.