use std::cell::RefCell;
use std::ops::Deref;
use std::rc::Rc;
use derivative::Derivative;
use yew::html::Scope;
use yew::prelude::*;
#[derive(Derivative)]
#[derivative(Clone(bound = ""), Default(bound = ""))]
pub struct WeakScope<C: Component>(Rc<RefCell<Option<Scope<C>>>>);
impl<C: Component> Deref for WeakScope<C> {
type Target = Rc<RefCell<Option<Scope<C>>>>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<C: Component> PartialEq for WeakScope<C> {
fn eq(&self, other: &Self) -> bool {
Rc::ptr_eq(&self.0, &other.0)
}
}