title: Ngrx selector not triggering when the reducer alters the slice
body: <p>I am working on an angular 2 application that uses Ngrx stores extensively. I got a  decent structure in my stores. I use selectors to retrieve slices of state and usually all the selectors properly triggers their associated subscriptions. Ngrx is amazing.</p>
  
  <p>Sadly, today I walked into a new issue and I tried looking around on the web for solutions without success. I finally found a work-around myself by testing out different syntax but I am curious as to why this is happening.</p>
  
  <p>This selector is exactly like all my other selectors:</p>
  
  <pre><code>export const getToolBars = (state: State): any =&gt; state.toolBars;
  export const selectState: MemoizedSelector&lt;object, State&gt; = createFeatureSelector&lt;State&gt;('http');
  export const selectToolBars: MemoizedSelector&lt;object, any&gt; = createSelector(selectState, getToolBars);
  </code></pre>
  
  <p>The problem is that the selector does not trigger the subscription like it should when the data is updated via the reducer.</p>
  
  <p>I found a work-around for this particular case. Using this :</p>
  
  <pre><code>export const getToolBars = (state: State): any =&gt; { return { toolBars: state.toolBars }; };
  </code></pre>
  
  <p>Instead of :</p>
  
  <pre><code>export const getToolBars = (state: State): any =&gt; state.toolBars;
  </code></pre>
  
  <p>fixes it but I would prefer to have all my getters look the same so I wonder why is this issue happening in the first place?</p>
  
  <p>Additional informations, the state.toolBars is an object interfaced as </p>
  
  <pre><code>toolBars: { [name: string]: any };
  </code></pre>
  
  <p>Any hints or references would do. Right now everything "works" I am only looking for ways to improve my skill set. Thank you very much!</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I made a stackblitz to illustrate the issue.</p>
  
  <p><a href="https://stackblitz.com/edit/angular-selector-issue?file=src%2Fapp%2Froot-store%2Ftest-store%2Fselectors.ts" rel="noreferrer">https://stackblitz.com/edit/angular-selector-issue?file=src%2Fapp%2Froot-store%2Ftest-store%2Fselectors.ts</a></p>
  
  <p>On this stackblitz, i made log to console for whenever stuff is being added in the toolBars state by the reducer. Every two seconds, a new entry is being added to the state.</p>
  
  <p>In the current state, the subscription is not triggering when the reducer add content.</p>
  
  <p>If in the selectors.ts we comment line 6 and uncomment line 7, it works as it does in my application. And I am wondering why usual syntax wont...</p>