title: How do I subscribe to a "window move" event in the Atom edtor?
body: <p>I want to subscribe to the window moving event that <code>electron</code> provides, but I don't know how to code it in an <code>atom</code> package.</p>
  
  <p>When I was reading the <a href="https://github.com/electron/electron/blob/master/docs/api/browser-window.md#event-move" rel="nofollow noreferrer">electron docs</a> I found an example that I think is similar to what I want:</p>
  
  <pre><code>const {BrowserWindow} = require('electron')
  let win = new BrowserWindow()
  win.on('move', (e) =&gt; {
    // . . .
  })
  </code></pre>
  
  <p>But this appears to require creating a new <code>electron</code> window, and I don't know how to get the current <code>BrowserWindow</code> in an existing <code>atom</code> window.</p>
  
  <p>I also can hook into the <code>window.onresize</code> event in <code>atom</code>, but there is no <code>window.onmove</code>.</p>
  
  <p>Lastly, I found a way to get the window position in the <a href="https://atom.io/docs/api/v1.18.0/AtomEnvironment#instance-getPosition" rel="nofollow noreferrer">atom docs</a>, but I don't know how that would be useful without polling.</p>