title: Angular & NGRX: Filtering on a selector using NGRX entity
body: <p>I am trying to filter out the payload data by a property. </p>
  
  <pre><code> //reducer.ts
  
    case MessagesActionTypes.LOAD_Message_SUCCESS: {
        console.log('reducer='+ 
        JSON.stringify(action.payload.Messages));//receiving data here
        return adapter.addAll(action.payload.Messages, state);
      }
  
      export const getSelectedMessageId = (state: MessageState) =&gt; state.selectedMessageId;
  
  // get the selectors
  const { selectIds, selectEntities, selectAll, selectTotal } = adapter.getSelectors();
  
  
  // select the array of Messages
  export const selectAllMessages = selectAll;
  </code></pre>
  
  <p>Below is the selector</p>
  
  <pre><code> //     Selector.ts
  
  export const selectHomeQueues = createSelector(
    fromReducer.selectAllMessages,
   (messages) =&gt; messages.filter(message =&gt; message.queue === 'HOME')
   );
  </code></pre>
  
  <p>I am <strong>receiving data</strong> in the reducer but <strong>getting error</strong> in the selector during runtime <code>ERROR TypeError: Cannot read property 'map' of undefined</code></p>
  
  <p>Note: I havent been able to find any example on filtering in NGRX entity selectors anywhere.</p>
  
  <p>How do we filter the selectors in NGRX entity?</p>