Is there specific advantages/disadvantages when using selectors vs not using a selectors? #2420
-
I saw that in the simple demo, the property and the action are extracted directly. While browsing the docs, however, it says that it's recommended to use the selectors when interacting with the properties and actions. Is there a specific advantage/disadvantage when using either? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@dmdum sure, let me explain you that a little bit: let's say you only have one field and no store actions. In that case would be the same using and not using selectors shouldn't be any difference. Now let's say you have two selectors but you are using them in two different components, each time you update one of them that would trigger a new render. How can avoid extra renders on a field that's not changing? the only way to achieve that is by using selectors. |
Beta Was this translation helpful? Give feedback.
@dmdum sure, let me explain you that a little bit: let's say you only have one field and no store actions. In that case would be the same using and not using selectors shouldn't be any difference. Now let's say you have two selectors but you are using them in two different components, each time you update one of them that would trigger a new render. How can avoid extra renders on a field that's not changing? the only way to achieve that is by using selectors.