phlow 3.0.0

An engine for scripting reactive browsers in Rust by adding custom views to structures
Documentation
#[macro_use]
extern crate phlow;

use phlow::view_functions_of_val;

environment!();

#[extensions(String)]
mod string_extensions {
    use phlow::{PhlowView, ProtoView};

    #[view]
    fn chars_for(_value: &String, view: impl ProtoView<String>) -> impl PhlowView {
        view.list()
            .title("Chars")
            .priority(1)
            .items(|value| value.chars().collect())
            .item_text(|item| item.to_string())
            .send(|item| item.to_string())
    }
}

pub fn main() {
    let string = "Hello".to_string();
    let view_method = view_functions_of_val(&string)
        .into_iter()
        .find(|f| f.name() == "chars_for")
        .unwrap();

    let _view = view_method.as_view(&string);
}