diff --git a/_examples/golang-sse/webapp/src/main.ts b/_examples/golang-sse/webapp/src/main.ts index 9b6bca6c..6acf77e4 100644 --- a/_examples/golang-sse/webapp/src/main.ts +++ b/_examples/golang-sse/webapp/src/main.ts @@ -1,17 +1,17 @@ import { effect, signal } from "@preact/signals-core"; -import { Chat, Message, SubscribeMessagesReturn, WebrpcError } from "./rpc"; +import { Chat, Message, SubscribeMessagesReturn, WebrpcError } from "./rpc.gen"; import "./style.css"; -//Create client +// Create client const api = new Chat("http://localhost:4848", fetch); -//Create signal for messages and log +// Create signal for messages and log const messages = signal([]); type Log = { type: "error" | "info" | "warn"; log: string }; const log = signal([]); -//Create message handlers +// Create message handlers const onMessage = (message: SubscribeMessagesReturn) => { console.log("onMessage()", message); messages.value = [...messages.value, message.message]; diff --git a/_examples/golang-sse/webapp/src/rpc.ts b/_examples/golang-sse/webapp/src/rpc.gen.ts similarity index 99% rename from _examples/golang-sse/webapp/src/rpc.ts rename to _examples/golang-sse/webapp/src/rpc.gen.ts index 75fa18f9..6effed83 100644 --- a/_examples/golang-sse/webapp/src/rpc.ts +++ b/_examples/golang-sse/webapp/src/rpc.gen.ts @@ -3,7 +3,7 @@ // -- // Code generated by webrpc-gen@v0.13.0 with typescript generator. DO NOT EDIT. // -// webrpc-gen -schema=chat.ridl -target=typescript -client -out=./rpc.ts +// webrpc-gen -schema=chat.ridl -target=typescript -client -out=./rpc.gen.ts // WebRPC description and code-gen version export const WebRPCVersion = "v1"; @@ -18,7 +18,7 @@ export const WebRPCSchemaHash = "a63a64964867e7edb412b0400e36220b6057c41c"; // Types // -//Global types +// Global types export type Fetch = ( input: RequestInfo,