Indexed

Function Indexed 

Source
pub fn Indexed<T, F>(props: IndexedProps<T, F>) -> TemplateResult
where T: Clone + PartialEq, F: Fn(T) -> TemplateResult + 'static,
Expand description

Non keyed iteration (or keyed by index). Use this instead of directly rendering an array of TemplateResults. Using this will minimize re-renders instead of re-rendering every single node on every state change.

For keyed iteration, see Keyed.

ยงExample

use maple_core::prelude::*;

let count = Signal::new(vec![1, 2]);

let node = template! {
    Indexed(IndexedProps {
        iterable: count.handle(),
        template: |item| template! {
            li { (item) }
        },
    })
};