Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

condensed code into a method, called method #27

Open
wants to merge 1 commit into
base: solution
Choose a base branch
from

Conversation

meldaravaniel
Copy link

demo instructions mentions a function that does this, yet the solution has the code duplicated in both the createRoom and joinRoomById methods. I consolidated those into one method, then had each aforementioned method call the new one with the corresponding strings. Also made those strings constants, since they're being used in three separate places.

demo mentions a function that does this, yet the solution has the code duplicated in both the createRoom and joinRoomById methods.  I consolidated those into one method, then had each aforementioned method call the new one with the corresponding strings.  Also made those strings constants, since they're being used in three separate places.
Copy link

@wayjake wayjake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a helpful addition to the code.

@@ -12,6 +12,9 @@ const configuration = {
iceCandidatePoolSize: 10,
};

const callerCandidatesString = 'callerCandidates';
const calleeCandidatesString = 'calleeCandidates';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more clear to remove "String" from the end of the variable declaration and make CALLER_CANDIDATES all caps to indicate it's a constant.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants