The "good" way would be creating a state machine inside your reducer. The good news is that the action.type can act as an event, so you only need to add a label to your state to make it work. The bad news is that it would involve some nesting conditionals so it may not look "elegant".
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The quick way that I can think of is using recursion.
The "good" way would be creating a state machine inside your
reducer
. The good news is that theaction.type
can act as an event, so you only need to add a label to your state to make it work. The bad news is that it would involve some nesting conditionals so it may not look "elegant".