freya-router 0.4.0

Router management for Freya apps
Documentation
use std::marker::PhantomData;

use freya_core::prelude::*;

use crate::prelude::{
    outlet::OutletContext,
    *,
};

pub struct Outlet<R>(PhantomData<R>);

impl<R> Default for Outlet<R> {
    fn default() -> Self {
        Self::new()
    }
}

impl<R> Outlet<R> {
    pub fn new() -> Self {
        Self(PhantomData)
    }
}

impl<R> PartialEq for Outlet<R> {
    fn eq(&self, _other: &Self) -> bool {
        true
    }
}

impl<R: Routable> Component for Outlet<R> {
    fn render(&self) -> impl IntoElement {
        OutletContext::<R>::render()
    }
}