title: Check if DOM associated with current ViewModel is displayed?
body: <p>I have a following use case:</p>
  
  <ul>
  <li><p>I'm creating Knockout custom component:</p>
  
  <pre><code>ko.components.register("detail", {
      template: {require: "text!components/detail.html"},
      viewModel: DetailViewModel
  });
  </code></pre></li>
  <li><p>Inside the <code>DetailViewModel</code>, I'm performing some e.g. XHR that takes 60 seconds to finish. In case the XHR fails, I'm showing user a notification about it.</p></li>
  </ul>
  
  <p>Now my problem is that the XHR takes 60 seconds and while it is still "pending", user navigates to a page that no longer contains the "detail" component and then the XHR fails. I don't want to show any notification in this case, simply because there is no use to show failure notification if the original component is no longer displayed.</p>
  
  <p>Is there a way to determine inside the <code>DetailViewModel</code> function if the associated DOM element is still "present" on page? Right now I'm using some custom defined property of the VM ("<code>isVisible</code>") and changing the property to <code>false</code> in <code>DetailViewModel.prototype.dispose</code>, but I was wondering if there is a easier/cleaner way to do that without declaring any custom property?</p>