UNPKG

picorpc

Version:

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

24 lines (14 loc) 464 B
/* IMPORT */ import createAbstractServer from '~/servers/abstract'; import {noop} from '~/utils'; import type {IProcedures, IMemoryServerOptions, IMemoryServer} from '~/types'; /* MAIN */ const createMemoryServer = <T extends IProcedures> ( options: IMemoryServerOptions<T> ): IMemoryServer => { const {procedures} = options; return createAbstractServer<T> ({ procedures, handler: noop }); }; /* EXPORT */ export default createMemoryServer;