why i need to give the state as params explicitly, then get the selector.
why it dont like a computed property, just use the selector. no need to use store.
Maybe i need to use store anyWhere, but i just want use selector.
is an Anti-pattern ?
Hi @huyansheng3
Yes, this question has come up a lot. I too feel the same way, and we have discussed it a lot in #270. For me personally, I am no longer using the selectors plugin anymore. I just like to keep my selectors outside the models https://github.com/rematch/rematch/issues/270#issuecomment-372547336. I don't find it too much boilerplate doing it that way. I think in the future we'll look to rewrite the selectors plugin.
Thanks!
I should also say that yes, it is annoying having to pass the store into the selectors. I think the plugin can definitely be improved... it's something I'd like to have working in a future version of the plugin for sure.
Great. i am expect the future version selector plugin .
Most helpful comment
Hi @huyansheng3
Yes, this question has come up a lot. I too feel the same way, and we have discussed it a lot in #270. For me personally, I am no longer using the selectors plugin anymore. I just like to keep my selectors outside the models https://github.com/rematch/rematch/issues/270#issuecomment-372547336. I don't find it too much boilerplate doing it that way. I think in the future we'll look to rewrite the selectors plugin.
Thanks!