Skip to content

Commit bb4e791

Browse files
committed
Update JS style: use 2 spaces, not 4
1 parent 40734be commit bb4e791

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

sample/HelloWorld/public/js/helloworld.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@ var publisher = OT.initPublisher('publisher');
66

77
// Attach an event handler for when the session dispatches the 'streamCreated' event.
88
session.on('streamCreated', function(event) {
9-
// This function runs when another client publishes a stream (eg. session.publish())
9+
// This function runs when another client publishes a stream (eg. session.publish())
1010

11-
// Subscribe to the stream that caused this event, put it inside the DOM element with id='subscribers'
12-
session.subscribe(event.stream, 'subscribers', {
13-
insertMode: 'append'
14-
}, function(error) {
15-
if (error) {
16-
console.error('Failed to subscribe', error);
17-
}
18-
});
11+
// Subscribe to the stream that caused this event, put it inside the DOM element with id='subscribers'
12+
session.subscribe(event.stream, 'subscribers', {
13+
insertMode: 'append'
14+
}, function(error) {
15+
if (error) {
16+
console.error('Failed to subscribe', error);
17+
}
18+
});
1919
});
2020

2121
// Connect to the Session using the 'apiKey' of the application and a 'token' for permission
2222
session.connect(token, function(error) {
23-
// This function runs when session.connect() asynchronously completes
23+
// This function runs when session.connect() asynchronously completes
2424

25-
// Handle connection errors
26-
if (error) {
27-
console.error('Failed to connect', error);
28-
} else {
29-
// Publish the publisher we initialzed earlier (this will trigger 'streamCreated' on other
30-
// clients)
31-
session.publish(publisher, function(error) {
32-
if (error) {
33-
console.error('Failed to publish', error);
34-
}
35-
});
36-
}
25+
// Handle connection errors
26+
if (error) {
27+
console.error('Failed to connect', error);
28+
} else {
29+
// Publish the publisher we initialzed earlier (this will trigger 'streamCreated' on other
30+
// clients)
31+
session.publish(publisher, function(error) {
32+
if (error) {
33+
console.error('Failed to publish', error);
34+
}
35+
});
36+
}
3737
});

0 commit comments

Comments
 (0)