Releases: SampaioLeal/wsRPC
Releases · SampaioLeal/wsRPC
0.0.2
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
Initial Release