@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 |
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 |
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 |
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 |
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 |
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 |
getOfficesLoadedAt = createSelector(getOfficesState, getResourceLoadedAt)
Example #7
Source File: app.reducer.ts From nica-os with MIT License | 5 votes |
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 |
getTasksState = createSelector(selectCustomerState, state => state.tasks)
Example #9
Source File: file-explorer.reducer.ts From nica-os with MIT License | 5 votes |
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 |
getProductDividendsState = createSelector(selectDepositProductsState, state => state.depositProductDividends)
Example #11
Source File: file-explorer.reducer.ts From nica-os with MIT License | 5 votes |
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 |
getOfficeSearchLoading = createSelector(getOfficeSearchState, getSearchLoading)
Example #13
Source File: file-explorer.reducer.ts From nica-os with MIT License | 5 votes |
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 |
getCustomerSearchLoading = createSelector(getCustomerSearchState, getSearchLoading)
Example #15
Source File: file-explorer.reducer.ts From nica-os with MIT License | 5 votes |
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 |
getUserSearchLoading = createSelector(getUserSearchState, getSearchLoading)
Example #17
Source File: file-explorer.reducer.ts From nica-os with MIT License | 5 votes |
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 |
getRoleSearchLoading = createSelector(getRoleSearchState, getSearchLoading)