reselect Questions

3

Solved

In redux-toolkit docs they suggest you to create the following definition to have proper types when you use useSelector hook: export const useAppSelector: TypedUseSelectorHook<RootState> = us...

4

Solved

I've been using object-oriented programming practices for 25 years and trying to move toward functional programming for the last 5 years, but my mind always goes towards OOP when I'm trying to do s...
Transpose asked 30/4, 2017 at 10:51

5

Solved

I'm having a pretty complex selectors structure in my project (some selectors may have up to 5 levels of nesting) so some of them are very hard to test with passing input state and I would like to ...
Sweetener asked 15/4, 2019 at 20:8

8

Solved

How do I pass additional parameters to combined selectors? I am trying to • Get data • Filter data • Add custom value to my data set / group data by myValue export const allData = state => s...
Ailurophile asked 27/10, 2016 at 17:44

2

Solved

I use redux-toolkit to generate selectors. I want to use them in my own custom reselect selectors with parameters. But I do not know how to type the return type of my selector? const selectOrganiza...
Bellona asked 9/3, 2021 at 18:57

6

I have a selector: const someSelector = createSelector( getUserIdsSelector, (ids) => ids.map((id) => yetAnotherSelector(store, id), ); // ^^^^^ (yetAnotherSelector expects 2 args) That y...
Ballarat asked 21/6, 2018 at 9:25

3

Solved

Selectors are efficient. A selector is not recomputed unless one of its arguments changes. I'm trying to debug a selector that is being called more often than expected. Is there a way to log wh...
Brentwood asked 17/12, 2019 at 14:29

3

Solved

I try to use selectors from reselect library in my Redux app. my selectors file looks: import { createSelector } from 'reselect' const postsSelectors = state => state.global.posts.allPostse; ...
Zurn asked 16/2, 2017 at 20:15

1

For memoization/performance consideration, using useSelector with ShallowEqual. Will there be some more benefits for performance optimization using "Reselect/createSelector" option ? Or b...
Deterrent asked 1/3, 2021 at 16:35

2

Solved

How can I memoize my rawTranscript variable so it doesn't trigger the useEffect below which subsequently triggers the expensive transcriptParser function? I've been trying a lot of different approa...
Yvetteyvon asked 22/8, 2021 at 14:2

3

Solved

I want to use the reselect with redux-form to get the value from redux. the problem is I don't know how to combine the getFormValues with reselect. it seems that I cannot access the state in the cr...
Solidary asked 6/3, 2018 at 0:3

2

I am using reselect lib in my React project. I've created Posts selector which works fine. Here's the code // selectors.ts const getPosts = (state: RootState) => state.posts.posts; export cons...
Kemberlykemble asked 26/5, 2021 at 5:40

2

Solved

My app already has a large collection of selectors used by the various container objects. These are great for accessing different parts of the state and make refactoring the state much easier. Now...
Buskirk asked 7/8, 2017 at 13:7

4

The app I'm creating has a lot of entities and relationships (database is relational). To get an idea, there're 25+ entities, with any type of relations between them (one-to-many, many-to-many). T...
Killarney asked 28/7, 2017 at 12:20

1

A standard reselect selector invalidates its memoized value and recomputes it if the input selectors fail a strict equality check: export const selectEmailsFromComments = createSelector( selectCo...
Magnolia asked 20/6, 2020 at 0:7

1

Solved

I have built an app on ReactJS 16.8.5 and React-Redux 3.7.2. When the app loads the app mounts, initial store is set and database subscriptions are set up against a Firebase Realtime Database. The...
Augean asked 24/4, 2020 at 9:45

3

Solved

I came across an example, where the mapStateToProps function is using memoization. I was just wondering how the "state" parameter is passed onto memoized selectors. After looking at the docs for re...
Syreetasyria asked 10/1, 2017 at 13:37

1

Solved

I want to create a memoized selector which will update automatically when the state in the redux store changes. I read about Reselect's createSelector here: https://redux.js.org/recipes/computing...
Impresa asked 24/12, 2019 at 7:35

2

Solved

I use reselect to get parts of my redux state. i have a list of objects in my state. One of my subselector for my create selector is a filter function of this list: state => state.list.filter(f...
Equestrian asked 20/6, 2016 at 8:47

2

Now I'm working in react-redux. I'm trying to get questions from state one-by-one. Generated unique ID to store the questions in the state, after user submits,answer also store with the question. ...
Sanskrit asked 1/3, 2017 at 21:57

0

The Situation Using react redux, in mapStateToProps for one of my container components, I pass down an object with 8+ keys for the sake of convenience. (I am aware that passing objects down is an ...
Newfashioned asked 17/10, 2019 at 20:52

0

First of all, I have already gone through: /react-redux/issues/779 Stackoverflow / React Redux rerenders when creating arrays Stackoverflow / How to deal with relational data in redux? Redux / Rec...
Vookles asked 2/8, 2019 at 6:34

1

Solved

I’m trying to understand how the reselect method createStructuredSelector works in Typescript. I see this pattern a lot: export interface SomeProps { readonly property1: string; readonly propert...
Saline asked 28/12, 2018 at 19:49

2

Solved

I am trying to integrate reselect into my current app and as always , first i begin to read documentation and then if it needed , another recources.I couldn't understand one special part of documen...
Scyros asked 2/10, 2018 at 11:35

1

Solved

I am implementing Reselect in my project and have a little confusion on how to properly use it. After following multiple tutorials and articles about how to use reselect, I have used same patterns ...
Countdown asked 5/9, 2018 at 7:3

© 2022 - 2025 — McMap. All rights reserved.