I have a SessionStore where as you might guess, I store and handle the firebase session object.
I have a component where it would be easy to ask if session has been created directly to the store (not firing an action), but I'm no sure this is an antipattern/bad practice or a valid option.
The question is, would it be considered bad practice since I'm breaking the normal View -> Action -> Store -> View flow?.
Thanks.
Your stores can provide an interface for the encapsulated state through methods like getItem
, getLength
or in your case userLoggedIn
. You should trigger actions only when you want to set new values in your stores. If your component only needs to read from the store, it is perfectly fine to call its methods directly.