Skip to content

Triggering an action from a reaction? #2608

Answered by urugator
Psidium asked this question in Q&A
Discussion options

You must be logged in to vote

If the business rule is that the field must be validated every time it's being modified, then setting a value and validating a value is coupled by design - there must be a place that couples these two actions and makes sure that you cannot invoke one without the other.
Reaction is basically globally shared event bus, it doesn't remove coupling, it just allows you to create the coupling ad-hoc - you can connect (and disconnect) anything to anything anytime anywhere. How do you want to reason about something like that?
Consider you want to know how the state changes when form.setPetType(value); is called. Unless someone gives you a list of all reactions you're unable to tell. But even then …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Psidium
Comment options

@urugator
Comment options

Answer selected by Psidium
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants