title: knockout validation subscribe update after change
body: <p>I have model 'search Parameters', which has two properties title and priceMax,both are required. When user change properties, script update quantity of offers from API.  Update is execute, when model 'searchParameters' hasn't errors. Problem is in metodh, which return count errors in model. When title and priceMax have value,  method return errors, only when I change property of model again method return value 0. Any idea? This is my solution.  </p>
  
  <blockquote>
    <p>HTML</p>
  </blockquote>
  
  <pre><code>   &lt;fieldset&gt;
        &lt;div class="row"&gt;
          &lt;label&gt;Title:&lt;/label&gt;
          &lt;input type="text" data-bind="textInput: searchParameters.title" /&gt;
  
        &lt;/div&gt;
  
        &lt;div class="row"&gt;
          &lt;label&gt;Price max:&lt;/label&gt;
          &lt;input data-bind="textInput: searchParameters.priceMax" /&gt;
  
        &lt;/div&gt;
        &lt;div class="row"&gt;
          &lt;label&gt;count offers:&lt;/label&gt;
          &lt;span data-bind="text: countOffers"&gt;&lt;/span&gt;
        &lt;/div&gt;
        &lt;div class="row" data-bind="visible:visibleProgress"&gt;
          progress...
        &lt;/div&gt;
      &lt;/fieldset&gt;
  </code></pre>
  
  <blockquote>
    <p>JS</p>
  </blockquote>
  
  <pre><code>function ViewModel() {
    var self = this;
    self.countOffers = ko.observable(0);
    self.visibleProgress = ko.observable(false);
    ko.extenders.refreshCountOffers = function(target, timeout) {
      var timerId = null;
      target.subscribe(function(newValue) {
        console.log(self.errors());
        if (self.errors().length === 0) {
          clearTimeout(timerId);
          timerId = setTimeout(function() {
            self.visibleProgress(true);
            //mock api
            $.ajax({
              url: '/echo/js/?js=' + Math.floor((Math.random() * 100)),
              data: {
                delay: 2
              },
              complete: function(response) {
                self.countOffers(response.responseText);
                self.visibleProgress(false);
              }
            });
            //mock api
          }, 500);
        } else
          self.countOffers(0);
      });
      return target;
    };
    self.searchParameters = {
      title: ko.observable().extend({
        refreshCountOffers: 500
      }).extend({
        required: true
      }),
      priceMax: ko.observable().extend({
        refreshCountOffers: 500
      }).extend({
        required: true
      })
    };
    self.errors = ko.validation.group(self.searchParameters);
  };
  
  var model = new ViewModel();
  ko.applyBindings(model);
  </code></pre>
  
  <p>my <a href="http://jsfiddle.net/llukaszz92/0vcmsk0c/" rel="nofollow">jsfiddle</a></p>