<commit_before>Template['components_nameStatus'].onCreated(function() {
    var template = this;
    function lookUp() {
      searched = Session.get('searched');
      if (!searched) {
        return;
      }
      //Two tasks: get address, and get entry.
      let tasks = 2;
      let address = null;
      let entry = null;
      function taskDone() {
        tasks--;
        if (tasks === 0) {
          TemplateVar.set(template, 'state', {
            name: searched + '.eth',
            address,
            entry
          })
        }
      }
      ens.resolver(searched + '.eth', (err, res) => {
        if (!err) {
          address = res.addr();
        }
        taskDone();
      });
      registrar.getEntry(searched, (err, res) => {
        if(!err) {
          entry = res;
        }
        taskDone();
      });
    }
    lookUp();
    this.updateStatusInterval = Meteor.setInterval(lookUp, 1 * 1000);
});

Template['components_nameStatus'].onDestroyed(function() {
    Meteor.clearInterval(this.updateStatusInterval);
});

Template['components_nameStatus'].helpers({
    searched() {
      return Session.get('searched');
    },
    state() {
      return TemplateVar.get('state');
    }
});<commit_msg>Look up name immediately after change<commit_after>Template['components_nameStatus'].onCreated(function() {
    var template = this;
    function lookUp() {
      var searched = Session.get('searched');
      if (!searched) {
        return;
      }
      //Two tasks: get address, and get entry.
      let tasks = 2;
      let address = null;
      let entry = null;
      function taskDone() {
        tasks--;
        if (tasks === 0) {
          TemplateVar.set(template, 'state', {
            name: searched + '.eth',
            address,
            entry
          })
        }
      }
      ens.resolver(searched + '.eth', (err, res) => {
        if (!err) {
          address = res.addr();
        }
        taskDone();
      });
      registrar.getEntry(searched, (err, res) => {
        if(!err) {
          entry = res;
        }
        taskDone();
      });
    }
    lookUp();
    this.autorun(function() {
      Session.get('searched');
      //Look up name on 'searched' change.
      lookUp();
    })
    this.updateStatusInterval = Meteor.setInterval(lookUp, 1 * 1000);
});

Template['components_nameStatus'].onDestroyed(function() {
    Meteor.clearInterval(this.updateStatusInterval);
});

Template['components_nameStatus'].helpers({
    searched() {
      return Session.get('searched');
    },
    state() {
      return TemplateVar.get('state');
    }
});
{'fraction_non_alphanumeric': 0.15009596928982727, 'fraction_numerical': 0.005374280230326296, 'mean_word_length': 1.9379932356257046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '6710533', 'n_tokens_mistral': 783, 'n_tokens_neox': 775, 'n_words': 155}