Skip to content

Commit

Permalink
docs: fixed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman035 committed Oct 3, 2023
1 parent 5633ccb commit 0982027
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/examples/sdk-backend-node/pushAPI/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const eventlistener = async (
eventName: string
): Promise<void> => {
pushAPI.stream.on(eventName, (data: any) => {
// if (showAPIResponse) {
console.log(data);
// }
if (showAPIResponse) {
console.log(data);
}
});
};

Expand All @@ -65,18 +65,14 @@ export const runPushAPIStreamCases = async (): Promise<void> => {
eventlistener(userAlice, STREAM.CHAT_OPS);
// -------------------------------------------------------------------
// -------------------------------------------------------------------
console.log(
'\n\nNew Chat Request, Expected Events:\n1. chat.request\n2. Spam Notification'
);
console.log('\n\nNew Chat Request, Expected Events:\n1. chat.request');
await userAlice.chat.send(secondSignerAddress, {
content: 'Hello Bob! from Alice',
});
await delay(3000); // Delay added to log the events in order
// -------------------------------------------------------------------
// -------------------------------------------------------------------
console.log(
'\n\nNew Chat Request, Expected Events:\n1. chat.request\n2. Spam Notification'
);
console.log('\n\nNew Chat Request, Expected Events:\n1. chat.request');
await userAlice.chat.send(thirdSignerAddress, {
content: 'Hello Kate! from Alice',
});
Expand All @@ -93,9 +89,7 @@ export const runPushAPIStreamCases = async (): Promise<void> => {
await delay(3000);
// -------------------------------------------------------------------
// -------------------------------------------------------------------
console.log(
'\n\nCreate Chat Group, Expected Events:\n1. chat.group.create\n2. Spam Notification'
);
console.log('\n\nCreate Chat Group, Expected Events:\n1. chat.group.create');
const groupChatId = (
await userAlice.chat.group.create('Test Grp', {
description: 'Test Desc',
Expand Down

0 comments on commit 0982027

Please sign in to comment.