Skip to content

Releases: SampaioLeal/wsRPC

0.0.2

21 Jan 01:18
Compare
Choose a tag to compare

Generic Client/Server

Now you can define contracts for your clients with Generics!

// service2/contract.ts
import { RPCReply } from "../../mod.ts";

type ServiceContracts = {
  hello: (clientName: string) => Promise<RPCReply<void>>;
};

export default ServiceContracts;

// service1/mod.ts

import Service2Contracts from "../service2/contract.ts"

const service2 = await initializeClient<Service2Contracts>({
  host: "ws://localhost:3002",
});

// and now you can type:
service2.
// and your editor will autocomplete the services defined in the contract like the hello() service

0.0.1

14 Jan 03:05
Compare
Choose a tag to compare

Initial Release