How much of this business logic belongs in Vuex? : <p>I have a simple app which pulls products from an API and displays them on-page, like this:</p>

<p><a href="https://i.stack.imgur.com/QcYeG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QcYeG.png" alt="enter image description here"></a></p>

<p>I've added Vuex to the app so that the search results as well as the product search array doesn't disappear when the router moves the user to a specific product page.</p>

<p>The search itself consists of the following steps:</p>

<ul>
<li>show loading spinner (update the <code>store</code> object)</li>
<li>dispatch an action to access the API</li>
<li>update the <code>store</code> object with products, spinner</li>
<li>decide if the product list is exhausted</li>
<li>hide loading spinner</li>
</ul>

<p>You get the idea.</p>

<p>With all of the variables stored in Vuex, it stands to reason all of the business logic should belong there as well, but should it really?</p>

<p>I'm talking specifically about accessing store params such as <code>productsExhausted</code> (when there are no more products to display) or <code>productPage</code> (which increments every time the infinite scroller module is triggered) etc.</p>

<p><strong>How much logic - and what kind - belongs in Vuex? How much does not?</strong></p>

<p>I was under the impression that Vuex is used for storage only but since all of the data is located there, fetching it all back to the Vue app only to send it all back seems like an overly verbose way to address the problem.</p>
