I am using flux architecture with React and I have an issue I don't know how to handle.
I need to write a logic that will listen to dispatched action (like a store) and will trigger an action in case the payload contains a specific value.
For example, assume there is an action that dispatch "ITEM_CREATED". My component should catch this "ITEM_CREATED" event and it's payload, and check whether the payload contains correct serial number. In case the serial number is incorrect, my component should execute an action.
Implementing this logic in a store will lead to a-synchronic store, moreover, in flux I can't trigger actions from store.
A possible solution is to create a "virtual" component (with falsy render() method) that will do that logic. Such solution will force me to put this virtual component in my JSX markup, which seams like a hack or a bad workaround.
I really want to know what is the flux solution for such scenario.
Thanks