Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek committed Dec 9, 2023
1 parent 117be72 commit d23ce91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions _examples/golang-sse/webapp/src/main.ts
Original file line number Diff line number Diff line change
@@ -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<Message[]>([]);

type Log = { type: "error" | "info" | "warn"; log: string };
const log = signal<Log[]>([]);

//Create message handlers
// Create message handlers
const onMessage = (message: SubscribeMessagesReturn) => {
console.log("onMessage()", message);
messages.value = [...messages.value, message.message];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// --
// Code generated by [email protected] 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";
Expand All @@ -18,7 +18,7 @@ export const WebRPCSchemaHash = "a63a64964867e7edb412b0400e36220b6057c41c";
// Types
//

//Global types
// Global types

export type Fetch = (
input: RequestInfo,
Expand Down

0 comments on commit d23ce91

Please sign in to comment.