title: In knockout.js how can I remove detached ko.observables when my items array has been replaced?
body: <p>I have a semi-complicated UI that among other things, keeps a running total of certain values the user inputs to make sure they add up to 100%. Since each data item itself is unaware of all of the other data items, I use a computed observable in the main model to handle this computation instead of an observable on the actual data item itself.</p>
  
  <p>I noticed that even when the user filters the list (via ajax call), even if I replace the list with a single item, there seem to be computed observables hanging around relating to all the now missing items, I am guessing it is because I use a function to generate 'dynamic' observables.</p>
  
  <p>I tried to use ko.cleanNode on my main 'table' but that just prevented it from refreshing at all. What is the proper way of dealing with computed observables in this scenario?</p>
  
  <p>the View:</p>
  
  <pre><code>&lt;span class="remainderText" data-bind="text:$root.getFieldTotal($data,'Customer')"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>The Model:</p>
  
  <pre><code>self.getFieldTotal = function (record, field) {
      return ko.computed(function () { 
                   .. some code here ...
              });
   }
  </code></pre>
  
  <p>When I go to replace the item array that drives the foreach, the computed observable fires off as if all the old items are still hanging around.</p>