You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling selector before actual data are arrived o get this error.
Uncaught TypeError: Cannot read property 'modules' of undefined
at selectors.ts:33
at index.js:70
at index.js:30
at index.js:84
at index.js:30
at index.js:80
at Object.selectModulesByApplicationId (index.js:30)
at HTMLElement.mapState (component.ts:12)
at HTMLElement.<anonymous> (index.ts:94)
at HTMLElement.<anonymous> (index.ts:85)
If i debug the selectors i can see that at first render slices are empty. There are no applications and modules, but from the component i am calling ModuleSelectors.selectModulesByApplicationId(state, { applicationId: this.appid }) and so there is no data match for the requested appid. After data arrives, reducer updates the state and component gets re-rendered, so from UI perspective user sees the data, but in console there is this error.
My assumption is that i should handle isFetching state for the components and call the selector only when fetching is done.
The text was updated successfully, but these errors were encountered:
When calling selector before actual data are arrived o get this error.
If i debug the selectors i can see that at first render slices are empty. There are no applications and modules, but from the component i am calling
ModuleSelectors.selectModulesByApplicationId(state, { applicationId: this.appid })
and so there is no data match for the requestedappid
. After data arrives, reducer updates the state and component gets re-rendered, so from UI perspective user sees the data, but in console there is this error.My assumption is that i should handle
isFetching
state for the components and call the selector only when fetching is done.The text was updated successfully, but these errors were encountered: