Browse Source

homework13 stage5 update done

holevchuk.evgeny 1 year ago
parent
commit
96030ccf1e
1 changed files with 2 additions and 4 deletions
  1. 2 4
      hw13/stage5.js

+ 2 - 4
hw13/stage5.js

@@ -43,14 +43,12 @@ const getMessages = async () => {
 }
 
 const sendAndCheck = async (nick, message) => {
-	await sendMessage(nick, message);
-	getMessages();
+	await Promise.all([sendMessage(nick, message), getMessages()]);
 }
 
 const checkLoop = async () => {
 	while (true) {
-		await delay(5000);
-		getMessages();
+		await Promise.all([delay(5000), getMessages()]);
 	}
 }