Fork me on GitHub

@andre yes indeed, that line of code seems to never be executed. As long as the mouse-up happens within the component, it all works fine. When outside however, the behaviour (while not a show stopper), is definitely quirky. Will add an issue.


Has anyone tried the fsm approach from this post? He mentions in the comments that it's part of a re-frame app.


@madstap Yeah, we're currently using something similar for re-frame apps where I work. It's worked pretty well for us.


We're prepping a lib to release as open-source that to help facilitate using FSMs with re-frame, but it's not quite ready yet.


Cool, looking forward to seeing that


I'll see if we can get something out in the next few days (even if rough) and will tag up with you.


I'm using it in a few places .. it's a useful pattern


I’m trying to understand how to use the enrich interceptor to do validation. I have a single field and I want to validate it’s contents before sending it’s value to a server. I’m trying to understand the flow of events and I want to make sure I have them correct. Am I on the right path with these steps: 1. Register an event handler with an enrich interceptor that does the validation. 2. Dispatch the registered event with the value of the input when a button is clicked. 3. In the event handler, assoc the value of the input in the db and include an :http-xhrio effect in the returned value. 4. The interceptor checks the value in the app-db and validates it. If the value is invalid, set a value in the app-db to indicate to the subscribed view to display an error AND then remove the :http-xhrio effect from the interceptor so the value is not submitted to the server.


Is this the right approach?


Is the last part of 4 correct, removing the effect to avoid submission to the server. Is that the place to do it?