UNPKG

picorpc

Version:

A tiny RPC library and spec, inspired by JSON-RPC 2.0 and tRPC.

19 lines (18 loc) 334 B
/* IMPORT */ /* MAIN */ class Response { /* CONSTRUCTOR */ constructor(handler, response) { this.handler = handler; this.response = response; } /* API */ exec() { this.handler(this.response); } valueOf() { return this.response; } } /* EXPORT */ export default Response;