title: What purpose does makeEmptyFunction serve in fbjs?
body: <p>I was looking through the React source and stumbled across a requirement with <code>var emptyFunction = require('fbjs/lib/emptyFunction');</code>.</p>
  
  <p>I looked at this function and was confused by what it does.</p>
  
  <p>Here is the function</p>
  
  <pre><code>function makeEmptyFunction&lt;T&gt;(arg: T): (...args: Array&lt;any&gt;) =&gt; T {
    return function() {
      return arg;
    };
  }
  
  const emptyFunction: (...args: Array&lt;any&gt;) =&gt; void = function() {};
  </code></pre>
  
  <p>In the comments, they give the following explanation which I was confused by:</p>
  
  <blockquote>
    <p>This function accepts and discards inputs; it has no side effects.
    This is primarily useful idiomatically for overridable function
    endpoints which always need to be callable, since JS lacks a null-call
    idiom ala Cocoa</p>
  </blockquote>
  
  <p>I have never come across <strong>null call idiom</strong> and was hoping someone could clarify what this means and explain the purpose of this function in less technical language.</p>
  
  <p>Hopefully this question will not get looked down on because it isn't exactly code related. Maybe it belongs somewhere else, if so I'm sorry. </p>