title: Best way to remove empty query strings from an API request
body: <p>In my react app I am tasked with sending multiple GET requests, sometimes with some optional filter params attached. Additionally I'm storing the params in my redux store so that they are able to stack on subsequent requests. Here's the problem: There are times when I'll clear the values of a param but since their keys are still saved to my store I'll get requests sent out like this:</p>
  
  <pre><code>/restaurants/?search=&amp;state_id=2
  </code></pre>
  
  <p>Notice how the <code>search</code> param value is empty (as expected). I was wondering what would be the best approach in removing these type of lingering params? I looked into lodash's <code>_.omitBy</code> combined with <code>_.isEmpty</code> but this throws a sort of false positive in dealing with numeric values like pagination.</p>
  
  <pre><code>_.omitBy(params, ._isEmpty);
  </code></pre>
  
  <p>I didn't think that providing <em>how</em> exactly the params are via react/redux was necessary stored but am happy to provide it if it helps.</p>
  
  <p><strong>Note:</strong> I'm using axios and passing my params in as an object as opposed to a string:</p>
  
  <pre><code>axios.get('restaurants', {
    params
  });
  </code></pre>