title: create a selector for a ngrx/data entity
body: <p>I have a state and I'd like to create selectors from ngrx/data entities.</p>
  
  <pre><code>import {
    Action,
    ActionReducer,
    ActionReducerMap,
    createFeatureSelector,
    createSelector,
    MetaReducer
  } from '@ngrx/store';
  import {environment} from '../../environments/environment';
  import * as fromRouter from '@ngrx/router-store';
  import * as fromDrawer from './drawer';
  import {InjectionToken} from '@angular/core';
  import {NavigationItem} from '../models/navigation-item';
  
  export interface State {
    router: fromRouter.RouterReducerState&lt;any&gt;;
    drawerNavigationItems: fromDrawer.State;
  }
  
  export const ROOT_REDUCERS = new InjectionToken&lt;ActionReducerMap&lt;State, Action&gt;&gt;('Root reducers token', {factory: () =&gt; ({
      router: fromRouter.routerReducer,
      drawerNavigationItems: fromDrawer.reducer,
    }),
  });
  
  export const metaReducers: MetaReducer&lt;State&gt;[] = !environment.production ? [] : [];
  
  export const selectRouter = createFeatureSelector&lt;
    State,
    fromRouter.RouterReducerState&lt;any&gt;
    &gt;('router');
  
  const {
    selectQueryParams,    // select the current route query params
    selectQueryParam,     // factory function to select a query param
    selectRouteParams,    // select the current route params
    selectRouteParam,     // factory function to select a route param
    selectRouteData,      // select the current route data
    selectUrl,            // select the current url
  } = fromRouter.getSelectors(selectRouter);
  
  export const selectRouteId = selectRouteParam('id');
  export const selectStatus = selectQueryParam('status');
  
  
  // Drawer
  
  export const selectDrawerNavigationItems = (state: State) =&gt; state.drawerNavigationItems.items as NavigationItem[];
  
  </code></pre>
  
  <p>How do I use the pre-defined selectors or write my own with entities or services that came from ngrx/data?</p>
  
  <p>As an example I'd like to create a selector that selects all "Community" entities and then, step 2, select 1 by <code>selectRouteId</code>.
  If you imagine a route <code>/communities/:id</code>, <code>selectRouteId</code> returns the Id, and now I'd like the data from the <code>CommunityService</code> and use the selector created or somehow imported and used in step 1 and return a result, 1 <code>Community</code> with the <code>selectRouteId</code>'s id, so I can later do something like <code>this.store.dispatch(selectCommunityByCurrentRouteId);</code></p>
  
  <p><strong>This question is specific to @ngrx/data.</strong></p>