mod.rs 419 Bytes
mod logic;
mod upload;
mod view;

use mogwai::prelude::*;

use self::{view::upload_view, logic::upload_logic};

pub(crate) async fn new() -> Component<Dom> {
    let (tx_logic, rx_logic) = broadcast::bounded(1);
    let (tx_previews, rx_previews) = mpmc::bounded(1);

    let view = upload_view(tx_logic, rx_previews);
    let logic = upload_logic(rx_logic, tx_previews);

    Component::from(view).with_logic(logic)
}