Skip to content

Commit

Permalink
feat: No app name
Browse files Browse the repository at this point in the history
Also add a custom event object in the example
  • Loading branch information
taorepoara committed Sep 29, 2023
1 parent 2e23ff2 commit 8e6a266
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions example/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { LenraApp } from '@lenra/client';

const app = new LenraApp({
appName: "Example Client",
clientId: "XXX-XXX-XXX",
});

Expand All @@ -18,7 +17,7 @@ app.connect().then(() => {
output.textContent = data.value;
button.onclick = () => {
output.classList.add("loading");
route.callListener(data.onIncrement).then(() => {
route.callListener({code: data.onIncrement.code, event: {value: "custom value"}}).then(() => {
output.classList.remove("loading");
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Callback } from "./route.js";
import LenraSocket, { LenraSocketOpts } from "./socket.js";

type LenraAppOpts = {
appName: string,
appName?: string,
clientId: string,
redirectUri?: string,
scopes?: string[],
Expand Down
2 changes: 1 addition & 1 deletion src/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Socket } from 'phoenix';
import LenraRoute, { Callback } from './route.js';

export type LenraSocketOpts = {
appName: string,
appName?: string,
token: string,
socketEndpoint: string,
}
Expand Down

0 comments on commit 8e6a266

Please sign in to comment.