sauron_native/
util.rs

1use crate::{event::on, Attribute, Callback, Event, Value};
2
3pub fn value<V, MSG>(v: V) -> Attribute<MSG>
4where
5    V: Into<Value>,
6{
7    attr("value", v)
8}
9
10pub fn oninput<C, MSG>(c: C) -> Attribute<MSG>
11where
12    C: Into<Callback<Event, MSG>>,
13{
14    on("input", c)
15}
16
17pub fn onclick<C, MSG>(c: C) -> Attribute<MSG>
18where
19    C: Into<Callback<Event, MSG>>,
20{
21    on("click", c)
22}
23
24pub fn attr<V, MSG>(name: &'static str, v: V) -> Attribute<MSG>
25where
26    V: Into<Value>,
27{
28    crate::builder::attr(name, v)
29}