Extracting ActorConn type

export class Actor {
conn: unknown | null = null;

init(userID: string, queryClient: QueryClient) {
const client = createClient<typeof registry>("http://localhost:8080");
const conn = client.stream.getOrCreate(userID).connect();
// how to extract the type of "conn" here?
this.conn = conn;
}
}

export const actor = new Actor();
export class Actor {
conn: unknown | null = null;

init(userID: string, queryClient: QueryClient) {
const client = createClient<typeof registry>("http://localhost:8080");
const conn = client.stream.getOrCreate(userID).connect();
// how to extract the type of "conn" here?
this.conn = conn;
}
}

export const actor = new Actor();
1 Reply
jog1t
jog1t4mo ago
Let me dig into the internals, You can use ActorConn type that’s exported from @rivetkit/core/client. this type is a generic type, so you can pass as a first parameter a type of the desired actor. Let me know if you need help with that

Did you find this page helpful?