title: ES6 Export Overwriting Function
body: <p>How can I export this overwriting function so that an importing module can check whether the function has been called?</p>
  
  <pre><code>// util.js
  export function isPageload() {
    return (!!(isPageload = function() { return false; }));
  }
  </code></pre>
  
  <p>When I compile that with Babel, I get this error:</p>
  
  <pre><code>Uncaught TypeError: (0 , _util2.default) is not a function
  </code></pre>
  
  <p>Here is the ES5 equivalent:</p>
  
  <pre><code>var isPageload = function() {
    return (!!(isPageload = function() { return false; }));
  }
  
  console.log(isPageload()); // true
  console.log(isPageload()); // false
  </code></pre>