mod.rs
547 Bytes
pub(crate) mod logic;
mod view;
use mogwai::prelude::*;
use self::{view::selector_view, logic::selector_logic};
type PatchSender = mpmc::Sender<ListPatch<ViewBuilder<Dom>>>;
type PatchReceiver = mpmc::Receiver<ListPatch<ViewBuilder<Dom>>>;
pub(crate) async fn new() -> Component<Dom> {
let (tx_previews, rx_previews) = mpmc::bounded(1);
let (tx_dom, rx_dom) = broadcast::bounded(1);
let view = selector_view(tx_dom, rx_previews);
let logic = selector_logic(rx_dom, tx_previews);
Component::from(view).with_logic(logic)
}