@ngrx/store#createSelector TypeScript Examples

The following examples show how to use @ngrx/store#createSelector. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: search.reducer.ts    From digital-bank-ui with Mozilla Public License 2.0 6 votes vote down vote up
getSearchResult = createSelector(
  getSearchEntities,
  getSearchTotalElements,
  getSearchTotalPages,
  (elements, totalElements, totalPages) => {
    return {
      elements,
      totalElements,
      totalPages,
    };
  },
)
Example #2
Source File: issue.selectors.ts    From ngrx-issue-tracker with MIT License 6 votes vote down vote up
selectStats = createSelector(
  selectEntities,
  (issues): IssueStats => {
    const resolved = issues.filter((issue) => issue.resolved);
    return {
      total: issues.length,
      resolved: resolved.length,
    };
  }
)
Example #3
Source File: selectors.ts    From geonetwork-ui with GNU General Public License v2.0 6 votes vote down vote up
isEndOfResults = createSelector(
  getSearchStateSearch,
  (state: SearchStateSearch) => {
    return (
      state.results.hits &&
      state.params.from + state.params.size >= state.results.hits.value
    )
  }
)
Example #4
Source File: index.ts    From router with MIT License 6 votes vote down vote up
selectBookCollection = createSelector(
  selectBookEntities,
  selectCollectionBookIds,
  (entities, ids) => {
    return ids
      .map((id) => entities[id])
      .filter((book): book is Book => book != null);
  }
)
Example #5
Source File: app.selectors.ts    From Angular-Cookbook with MIT License 6 votes vote down vote up
selectSimilarUsers = createSelector(
  selectUserUUID,
  selectUsers,
  (uuid, users: IUser[]) =>
    users
      ? users.filter((user) => {
          return user.login.uuid !== uuid;
        })
      : null
)
Example #6
Source File: index.ts    From digital-bank-ui with Mozilla Public License 2.0 5 votes vote down vote up
getOfficesLoadedAt = createSelector(getOfficesState, getResourceLoadedAt)
Example #7
Source File: app.reducer.ts    From nica-os with MIT License 5 votes vote down vote up
selectLoadedAssets = createSelector(
  selectAppState,
  (state: AppState) => state.loadedAssets
)
Example #8
Source File: index.ts    From digital-bank-ui with Mozilla Public License 2.0 5 votes vote down vote up
getTasksState = createSelector(selectCustomerState, state => state.tasks)
Example #9
Source File: file-explorer.reducer.ts    From nica-os with MIT License 5 votes vote down vote up
selectFilesByCurrentPath = createSelector(selectFileExplorerState, (state: FileExplorerState) => state.files.filter(file => file.fs.paths.indexOf(state.currentPath) > -1))
Example #10
Source File: index.ts    From digital-bank-ui with Mozilla Public License 2.0 5 votes vote down vote up
getProductDividendsState = createSelector(selectDepositProductsState, state => state.depositProductDividends)
Example #11
Source File: file-explorer.reducer.ts    From nica-os with MIT License 5 votes vote down vote up
selectApplications = createSelector(selectFileExplorerState, (state: FileExplorerState, props?: { path: string }) => props && props.path ? state.applications.filter(app => app.properties.fs.paths.indexOf(props.path) > -1) : state.applications)
Example #12
Source File: index.ts    From digital-bank-ui with Mozilla Public License 2.0 5 votes vote down vote up
getOfficeSearchLoading = createSelector(getOfficeSearchState, getSearchLoading)
Example #13
Source File: file-explorer.reducer.ts    From nica-os with MIT License 5 votes vote down vote up
selectFiles = createSelector(selectFileExplorerState, (state: FileExplorerState, props?: { path: string }) => props && props.path ? state.files.filter(file => file.fs.paths.indexOf(props.path) > -1) : state.files)
Example #14
Source File: index.ts    From digital-bank-ui with Mozilla Public License 2.0 5 votes vote down vote up
getCustomerSearchLoading = createSelector(getCustomerSearchState, getSearchLoading)
Example #15
Source File: file-explorer.reducer.ts    From nica-os with MIT License 5 votes vote down vote up
selectApplicationsByCategory = createSelector(selectFileExplorerState, (state: FileExplorerState, props?: { category: APPLICATION_CATEGORY }) => props && props.category ? state.applications.filter(app => app.properties.fs.category === props.category) : [])
Example #16
Source File: index.ts    From digital-bank-ui with Mozilla Public License 2.0 5 votes vote down vote up
getUserSearchLoading = createSelector(getUserSearchState, getSearchLoading)
Example #17
Source File: file-explorer.reducer.ts    From nica-os with MIT License 5 votes vote down vote up
selectApplicationsByCurrentPath = createSelector(selectFileExplorerState, (state: FileExplorerState) => state.applications.filter(app => app.properties.fs.paths.indexOf(state.currentPath) > -1))
Example #18
Source File: index.ts    From digital-bank-ui with Mozilla Public License 2.0 5 votes vote down vote up
getRoleSearchLoading = createSelector(getRoleSearchState, getSearchLoading)