cranpose-ui 0.0.60

UI primitives for Cranpose
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! ForEach iteration helper

#![allow(non_snake_case)]

use crate::composable;
use std::hash::Hash;

#[composable(no_skip)]
pub fn ForEach<T, F>(items: &[T], mut row: F)
where
    T: Hash,
    F: FnMut(&T) + 'static,
{
    for item in items {
        cranpose_core::with_key(item, || row(item));
    }
}