feat: add FlatVDom types and evaluate_vdom_flat helper
This commit is contained in:
@@ -18,7 +18,7 @@ use reader::Reader;
|
||||
use rhei::RHEI_PREFIX;
|
||||
use style::{AncestorInfo, ComputedStyle, StructuralContext};
|
||||
pub use types::Value;
|
||||
use types::{FlatVDom, VNode};
|
||||
use types::FlatVDom;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
pub struct Interpreter;
|
||||
@@ -334,6 +334,18 @@ impl Interpreter {
|
||||
Self::evaluate_vdom_incr(&refs, variables, components, rhei, stylesheet, ancestors, &HashSet::new())
|
||||
}
|
||||
|
||||
pub fn evaluate_vdom_flat<'a>(
|
||||
templates: &[Element<'a>],
|
||||
variables: &mut HashMap<String, Value>,
|
||||
components: &HashMap<String, ComponentDef<'a>>,
|
||||
rhei: &RheiContext,
|
||||
stylesheet: &SS,
|
||||
ancestors: &[AncestorInfo],
|
||||
) -> FlatVDom<'a> {
|
||||
let elements = Self::evaluate_vdom(templates, variables, components, rhei, stylesheet, ancestors);
|
||||
FlatVDom::from_elements(&elements)
|
||||
}
|
||||
|
||||
pub fn evaluate_vdom_incr<'a>(
|
||||
templates: &[&Element<'a>],
|
||||
variables: &mut HashMap<String, Value>,
|
||||
|
||||
Reference in New Issue
Block a user