Skip to content

Inversion of Control: In Parent-Child relation, do I always need to declare the reducer for the child? How can I test the action that's handled by the parent reducer? #411

Answered by stephencelis
bielikb asked this question in Q&A
Discussion options

You must be logged in to vote

Does it then make sense to actually test the MeetingFooterView itself?

I'd say so! The assertion that state doesn't change could be beneficial down the line. If the child ever changes its logic to do something internally, the test would begin to fail.

And could this inversion of control to be considered anti-pattern in some way?

Not at all! It's a pattern similar to the delegate pattern. The child provides delegate actions that a parent can listen to. In our projects we even like to group all delegate actions into a single case delegate 😄

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bielikb
Comment options

Answer selected by bielikb
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