node/p2p/
p2p_effects.rs

1use crate::{Service, Store};
2use p2p::P2pEffectfulAction;
3use redux::ActionWithMeta;
4
5pub fn node_p2p_effects<S: Service>(
6    store: &mut Store<S>,
7    action: ActionWithMeta<P2pEffectfulAction>,
8) {
9    let (action, meta) = action.split();
10
11    match action {
12        P2pEffectfulAction::Initialize =>
13        {
14            #[cfg(feature = "p2p-libp2p")]
15            if store.state().p2p.ready().is_some() {
16                store.service().start_mio();
17            }
18        }
19        action => action.effects(meta, store),
20    }
21}