Questions tagged [ngrx-selectors]

30 questions
3
votes
1 answer

How to call a ngrx selector inside an another selector (which accepts a parameter to compute)

I created two selectors To get all networks - export const getAllNetworks = createSelector(getState, state => state.networks); get devices for each network createSelector(getAllNetworks, network => { const selectedNetwork =…
kireeti9
  • 228
  • 3
  • 6
3
votes
1 answer

NGRX selectors: factory selector within another selector without prop in createSelector method

Using the factory selector pattern const selectA = (id: number) => createSelector(...) I have an instance where I want to reuse this selector within another selector (that iterates through an array of IDs) but I don't know the value to pass into the…
Tr1stan
  • 2,755
  • 1
  • 26
  • 45
2
votes
1 answer

Property 'todos' is missing in type '{}' but required in type 'AppState'

I'm trying to learn reactive state for Angular using NgRx by creating a Todo list application. To do this, first I started by creating two main components add-todo todo-list Then I created an interface for what a todo should be. export interface…
onTheInternet
  • 6,421
  • 10
  • 41
  • 74
2
votes
1 answer

NGRX: how to call factory selectors from within other selectors

Since NGRX deprecated selectors with props in version 11. and the expected method for using properties is to create factory selectors, how can you nest selectors, or call one from another and pass the state between them? Prior to the change, with…
Edward
  • 1,076
  • 1
  • 12
  • 24
1
vote
0 answers

cross feature selectors in new ngrx14+

i'm trying to use the new syntax createFeature() for my new angular project but there is this one thing stopping me, i don't know how to implement cross feature selectors using the new api i'm reading from this…
Faz Fazzi
  • 13
  • 4
1
vote
1 answer

How to combine two dynamic selectors to a new selector?

I have the following selector static orderFilteredByStatus(status: string){ return createSelector([OrderState], (state: OrderStateModel) => {...} } Now I have another selector in a different state. static status(name: string) return…
Invader
  • 141
  • 6
1
vote
1 answer

Agular Store effects not waiting for selectors data

Am working on an Angular project using NgRx store. All the back end responses are saved in the store. This is my effects.ts loadData$ = createEffect(() => this.actions$.pipe( ofType('[Data] Load Data'), concatMap((action: any) =>…
arj
  • 887
  • 1
  • 15
  • 37
1
vote
2 answers

How to access nested property from ngrx selector Observable?

Initial Data definition and Interface: export interface IInitialData { version: { patch?: string; Version: string, build: number, }; } export const initialStateInitialData = { version: { build: 0, …
Akul Aggarwal
  • 61
  • 2
  • 6
1
vote
1 answer

How to get a different state in your selector or how to use a selector inside of a selector

I have the following selector const getLinkFeatureState = createFeatureSelector('link'); export const getLinkIsLinkDtoPricesDeliveryTimesSome = (index: number) => createSelector( getLinkFeatureState, state =>…
Noah Bergh
  • 493
  • 4
  • 14
1
vote
1 answer

NGRX createSelector object get middle line, when create special selector with filter (Update to NGRX 2021)

Hello guys I am create a selector that filter some thinks from the store but when I implement that on selectors it create a line on the object. The selector work properly but I see middle line on it like something isn't 100% well. How can I fix it?…
Lichay Tiram
  • 283
  • 3
  • 12
1
vote
2 answers

Compose ngrx selector combining MemoizedSelector with plain selector

I have a large project that's slowly migrating to the new ngrx syntax. We have many selectors that are plain functions like this: export function appDetailsSelector(state$: Observable): Observable { return…
charmeleon
  • 2,693
  • 1
  • 20
  • 35
0
votes
1 answer

this.store.select(selectValues) Vs this.store.pipe(select(selectValues)) in NgRx

On this page of NgRx selectors, there are few ways the select function can be called. this.store.select(selectValues) this.store.pipe(select(selectValues)) this.store.pipe(map(state => selectValues(state))) What are the differences between the…
wonderful world
  • 10,969
  • 20
  • 97
  • 194
0
votes
1 answer

NgRx selectors and currying

I have been using NgRx for a while and trying to understand the functional language feature or design pattern being used to create selectors as described on this NgRx documentation page. Coming from a Object Oriented Programming background, seeing…
wonderful world
  • 10,969
  • 20
  • 97
  • 194
0
votes
1 answer

Selectors with props are deprecated

On the 2nd line, I am getting this error: Selectors with props are deprecated. const getUserProfileState = createFeatureSelector(authorizationFeatureKey); const hasPermission = createSelector( getUserProfileState, (state:…
0
votes
1 answer

Combine selectors only when both emited values

I have 2 selectors selectAllJournals, selectAllAccounts that emit values at different times. The combined selector needs a value from selectAllAccounts as soon as there is a value emitted from selectAllJournals. Right now I check in the mapping…
Mathias F
  • 15,906
  • 22
  • 89
  • 159
1
2