yewlish-utils 0.1.12

Common utils for yewlish component set
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use yew::{html::IntoPropValue, AttrValue};

#[derive(Clone, Debug, PartialEq)]
pub enum Dir {
    Ltr,
    Rtl,
}

impl IntoPropValue<Option<AttrValue>> for Dir {
    fn into_prop_value(self) -> Option<AttrValue> {
        match self {
            Dir::Ltr => Some("ltr".into()),
            Dir::Rtl => Some("rtl".into()),
        }
    }
}