This PR inspects the unwrapped value, and if it's constructor is of RpcProperty, it handles binding by returning a different function that calls the RPC property as if it was bound.
I checked, and this sort of introspection is not unlike what Cloudflare do in their own Miniflare project:
Fixes #139.
This PR inspects the unwrapped value, and if it's constructor is of
RpcProperty
, it handles binding by returning a different function that calls the RPC property as if it was bound.I checked, and this sort of introspection is not unlike what Cloudflare do in their own Miniflare project:
https://github.com/cloudflare/workers-sdk/blob/d0754780c6d9a12984f1e4ed9b4f0952ba6b0888/packages/miniflare/src/workers/core/proxy.worker.ts#L223