title: How to cancel/ignore an action in redux
body: <p>Is there a way to cancel an action or ignore it?</p>
  
  <p>Or rather what is the best/recommended way to ignore an action?</p>
  
  <p>I have the following action creator and when I input an invalid size (say <code>'some_string'</code>) into the action creator, in addition to getting my own warning message I also get:
  <code>Uncaught Error: Actions must be plain objects. Use custom middleware for async actions.</code></p>
  
  <pre><code>import { SET_SELECTED_PHOTOS_SIZE } from './_reducers';
  
  export default (size=0) =&gt; {
    if (!isNaN(parseFloat(size))) {
      return {
        type: SET_SELECTED_PHOTOS_SIZE,
        size: size,
      };
    } else {
      app.warn('Size is not defined or not a number');
    }
  };
  </code></pre>
  
  <p>I've discussed this in the <code>redux</code>-channel in Discord (reactiflux) where one suggestion was to use redux-thunk like this:</p>
  
  <pre><code>export default size =&gt; dispatch =&gt; {
    if (!isNaN(parseFloat(size))) {
      dispatch({
        type: SET_SELECTED_PHOTOS_SIZE,
        size: size,
      });
    } else {
      app.warn('Size is not defined or not a number');
    }
  }
  </code></pre>
  
  <p>The other option was to ignore the action inside the reducer. This does make the reducer "fatter" because it then has more responsibilities, but it uses less thunk-actions which makes it easier to debug. I could see the thunk-pattern getting out of hand since I would be forced to use it for almost every action, making batched actions a bit of a pain to maintain if you have lots of them.</p>