title: AmCharts 3 - Remove Listener on first run (reference function inside itself)
body: <p>I would like to know how to add a listener that only runs once, I believe in the end this is mostly a generic javascript question, but I might be missing something.</p>
  
  <p>Here's what I have :</p>
  
  <pre><code>const listener = chart.addListener('rendered', () =&gt; {
      console.log('Chart rendered! This should only print once!');
      doSomethingToChart(chart);
      chart.removeListener(chart, 'rendered', listener);
  })
  </code></pre>
  
  <p>The problem here is, is not removing the listener, the console.log is printing on each render. How can I fix this?</p>