title: aframe-state component: remove function not called on removing entities produced by bind-for
body: <p>I have such template :</p>
  <pre><code>&lt;a-entity bind-for=&quot;for: item; in: creatures; key: id; updateInPlace: true&quot;&gt;
    &lt;template&gt;
      &lt;a-entity 
          bind-item__uw-id=&quot;item.id&quot;
          bind-item__position=&quot;item.position&quot;
          bind-item__rotation=&quot;item.rotation&quot;
          bind-item__scale=&quot;item.scale&quot;
          bind-item__uw-name=&quot;item.name&quot;
          bind-item__gltf-model=&quot;item.url&quot;
          animation-mixer&gt;&lt;/a-entity&gt;
    &lt;/template&gt;
  &lt;/a-entity
  </code></pre>
  <p>After some event I want to remove all the entities from my scene. I'm trying to do it the following way:</p>
  <pre><code>export const cleanScene = () =&gt; {
      const camera = document.querySelector('a-camera')
      if (camera) {
          camera.parentNode.removeChild(camera);
          camera.destroy();
      }
  
      removeAframEntities('a-entity[bind-item__uw-id]');
      removeAframEntities('a-entity[bind-for]');
      removeAframEntities('a-entity');
      // document.querySelector('a-scene').systems.state.subscriptions = []; // - workaround
  }
  
  function removeAframEntities(selector) {
      document.querySelectorAll(selector).forEach(e =&gt; {
          e.parentNode.removeChild(e);
          if (e.destroy) {
              e.destroy();
          }
      });
  }
  </code></pre>
  <p>Then when I dispatch an event to the state, I'm getting the following error:</p>
  <pre><code>Uncaught TypeError: Cannot read property 'emit' of null
      at NewComponent.renderItemsInPlace (aframe-state-component.js:954)
      at NewComponent.&lt;anonymous&gt; (aframe-state-component.js:906)
      at NewComponent.onStateUpdate (aframe-state-component.js:1039)
      at NewSystem.&lt;anonymous&gt; (aframe-state-component.js:367)
  </code></pre>
  <p>This is because there is no entity to update, but there are still subscribers in the state. Apparently the <code>remove()</code> function wasn't called for the entities produced by the template loop (all the other subscribers are gone). Previously I was removing the entities by only calling <code>removeAframEntities('a-entity');</code>, I tried to explicitly remove the produced entities and the one with bind-for attribute, but it didn't solve my issue. What I'm doing wrong?</p>
  <p><strong>Update</strong></p>
  <p>Just checked the components code and it turned out that bind-for and bind-item components don't even have a <code>remove()</code> function. How they're supposed to be removed?</p>