-
-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(perf): document the correct way reference to state.firestore when creating selectors #614
Comments
Thanks for reporting! Performance has been a big focus for the |
I'm using |
I don't think memoizing To sum up about this issue, For correct example
With this |
@illuminist I agree - we should add more to the docs about this |
Closing since a reselect section with a similar example has been added to both Thanks to everyone for posting |
* feat(auth): remove `signIn` option from createUser (new user is automatically signed in through Firebase SDK) - #513 * feat(core): new pattern for getting extended firebase instance in thunks (added back `getFirebase` to api) - #635 * fix(HOCs): switch to `UNSAFE_componentWillReceiveProps` in class based HOCs to prevent warnings with 16.9.0 - #755 * fix(HOCs): switch `withFirebase` and `withFirestore` back to pre-hooks compatible logic * fix(core): replace lodash methods such as `isArray`, `isBoolean`, `isString`, `size`, `compact` and `isFunction` with native methods in a number of places * chore(deps): update lodash to 4.17.15 * chore(docs): add docs for how to reference data from state for reselect selectors - #614 * chore(docs): update client side role assign example in roles recipes - #699 * chore(docs): add example for assigning role in cloud function - #699
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
For some reason i dont understand the reference to
state.firestore
is changed with every action.When using default memoization used by reselect's
createSelector
, the data is never memoized (the default memoization uses reference equality). This issue causes too many unnecessary updates of any react component that depends on the data fromstate.firestore
.What is the expected behavior?
The reference to the main object shouldn't be changing with every actions so the default memoization using object reference would work.
My hack is to memoize
state.firestore
using lodash'sisEqual
. This solution is not optimal due to the complexity of the comparison.The text was updated successfully, but these errors were encountered: