Replies: 1 comment 4 replies
-
Reducers update the state as appropriate for each action. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm fairly new to Fluxor so far and don't really have that much experience with the concept either, so it might be a relative obvious solution to my problem or maybe no solution because Fluxor and MVVM contradicts each other.
I currently use Blazorise as library to be able to bind ICommand derived properties to my button executions etc. I have a button to submit my login form to the server and receive an authentication token out of it. What I would like to do now is after I received the authentication token from the server to launch an action to change the state to "logged in" so that my View can update, i.e. remove the Login/Register components and add components to get used when the user is logged in.
I know how I can do that theoretically like I could probably pass the dispatcher to my command or don't do it in a command but I wonder if there would be a more.... convenient solution for what I'm trying or if maybe Fluxor is not the right library to use when I also want to do MVVM.
I also thought it would maybe make sense to run the dispatcher when I click on my button right away but it doesn't really seem right since I would first need to send data to the server, receive the token and only if I actually receive a token I'd like to update the state. I could probably update the action anyway even if I don't get an authentication token back but it still doesn't look like the right approach to me.
Beta Was this translation helpful? Give feedback.
All reactions