title: I'm trying to avoid calling dispatch inside a state reducer, and I'm not sure if redux-thunk is the solution I need
body: <p>I'm still new to using Redux, but basically I'm creating a javascript scientific calculator for a learning project, and I'm not quite sure if I'm on the right track. basically, the calculator is going to use a stack in the form of an array with parenthetical groupings within an expression being represented as a reference to another element in the stack which contains the expression contained in the parentheses.</p>
  
  <p>for example, <code>3 * (4 + 1)/5 + ln(6+8)</code> would be represented by </p>
  
  <pre><code>[
    [4, '*', 'ref:1', '/', 5, '+', 'ln', 'ref:2'], 
    [4, '+', 1], 
    [6, '+', 8]
  ]
  </code></pre>
  
  <p>I'm creating various reducers to handle different pieces. For example, one reducer will handle adding operators to the stack, while another will handle adding numbers to the stack. (after adding their respective elements, each reducer will call two functions that are not a part of the Redux store to handle rendering the input and evaluating/rendering the output into strings, which are also parts of the state object).</p>
  
  <p>Now obviously if the user hits, for example, the number 2, and the last element is the number 3, then the result would be to transform the element into the number 32. However, if the last element is 2, and the user hits the pi key, then I would want to add a '*' operator and THEN 3.14159. </p>
  
  <p>Now it wouldn't make sense for the number reducer to handle adding the '*' operator, and I understand from <a href="https://stackoverflow.com/questions/36730793/can-i-dispatch-an-action-in-reducer">this question</a> that calling dispatch from the reducer is considered to be an "anti-pattern". Is this where Redux-Thunk would step in, or is there some other solution that I should be looking at?</p>
  
  <p>Also, I was reading <a href="https://redux.js.org/faq/reducers#how-do-i-share-state-between-two-reducers-do-i-have-to-use-combinereducers" rel="nofollow noreferrer">this article</a> and I'm not quite sure what they mean when they say that two reducers can't share state slices. What exactly is a single slice, and how is one slice differentiated from another within the combineReducers function?</p>