consumeWith method
This helper function can be used in different scenarios where you have a Cmd and need to process them using an available dispatch in the context.
One of such scenarios could be integration tests to guarantee the messages being emitted or in subscriptions where you have a dispatch function that you might want to share an existing Cmd to be consumed in response to an event.
Implementation
void consumeWith(Dispatch<Msg> dispatch) =>
_commands.forEach((effect) => effect(dispatch));