title: How to refresh cart if there is no product left?
body: <p>I need to refresh my cart page everytime, when products.length is 0 but I can't figure out how to write that if condition, now it writes unreachable code.
  I think it is something simple, so I am here to ask.</p>
  <pre><code> switch (action.type){ 
       case &quot;REMOVE_PRODUCT&quot;:
        return products.filter((p) =&gt; p.id !== action.productId);
        if (products.length === 0) {
          window.location.reload();
        }
  }
  </code></pre>