Skip to content

subscribeWithSelector triggers on every store update, even if there is no change #2103

Answered by dai-shi
ivancuric asked this question in Bug report
Discussion options

You must be logged in to vote

So to have it not trigger, would I have to use a shallow comparison function when subscribing?

It depends on your goal.
I think triggering a callback (that does nothing based on a condition) can be more lightweight than a shallow comparison.
(but, in general, we need to "measure" to discuss performance. all I'm saying is hypothetical or intuitive.)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ivancuric
Comment options

@dai-shi
Comment options

@ivancuric
Comment options

@dai-shi
Comment options

Answer selected by ivancuric
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants