<commit_before>"use strict";
const connection = new wfc.Connection("ws://127.0.0.1:8080/westfield");
connection.registry.listener.global = (name, interface_, version) => {
    if (interface_ === "example_global") {
        const exampleGlobal = connection.registry.bind(name, interface_, version);
        const exampleClock = exampleGlobal.create_example_clock();
        exampleClock.listener.time_update = (time) => {
            document.getElementById("the_time").innerHTML = time.toString();
        };
    }
};<commit_msg>add comments to js example<commit_after>"use strict";
const connection = new wfc.Connection("ws://127.0.0.1:8080/westfield");//connect to the server
connection.registry.listener.global = (name, interface_, version) => {//register a listener to will be notified if a new global appears
    if (interface_ === "example_global") {//check if we support the global
        const exampleGlobal = connection.registry.bind(name, interface_, version);//create a new object that will be bound to the global
        const exampleClock = exampleGlobal.create_example_clock();//create a new clock object
        exampleClock.listener.time_update = (time) => {//listen for time updates
            document.getElementById("the_time").innerHTML = time.toString();//show the time
        };
    }
};
{'fraction_non_alphanumeric': 0.12804878048780488, 'fraction_numerical': 0.01524390243902439, 'mean_word_length': 3.7745454545454544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6747491', 'n_tokens_mistral': 348, 'n_tokens_neox': 336, 'n_words': 95}