Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
cloutiertyler committed Feb 8, 2025
2 parents 71062c8 + 333da18 commit 1970fc7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/quickstart-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ It is based directly on the plain React + TypeScript + Vite template. You can fo

You can follow the instructions for creating your own SpacetimeDB module here: [SpacetimeDB Rust Module Quickstart](https://spacetimedb.com/docs/modules/rust/quickstart). Place the module in the `quickstart-chat/server` directory for compability with this project.

In order to run this example, you need to:

- `pnpm compile` in the root directory (`spacetimedb-typescriptsdk`)
- `pnpm install` in this directory
- `pnpm run build` in this directory
- `pnpm run dev` in this directory to run the example

Below is copied from the original template README:

# React + TypeScript + Vite
Expand Down
16 changes: 16 additions & 0 deletions examples/quickstart-chat/src/module_bindings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export class RemoteReducers {
private setCallReducerFlags: SetReducerFlags
) {}

<<<<<<< HEAD
onIdentityConnected(callback: (ctx: ReducerEventContext) => void) {
this.connection.onReducer('identity_connected', callback);
}
Expand All @@ -135,6 +136,21 @@ export class RemoteReducers {
}

removeOnIdentityDisconnected(callback: (ctx: ReducerEventContext) => void) {
=======
onIdentityConnected(callback: (ctx: EventContext) => void) {
this.connection.onReducer('identity_connected', callback);
}

removeOnIdentityConnected(callback: (ctx: EventContext) => void) {
this.connection.offReducer('identity_connected', callback);
}

onIdentityDisconnected(callback: (ctx: EventContext) => void) {
this.connection.onReducer('identity_disconnected', callback);
}

removeOnIdentityDisconnected(callback: (ctx: EventContext) => void) {
>>>>>>> main
this.connection.offReducer('identity_disconnected', callback);
}

Expand Down

0 comments on commit 1970fc7

Please sign in to comment.