pub fn state<'a, S: CycleCollectionWithInitial<'a, TickCycle, Location = Tick<L>>, L: Location<'a> + NoTick>(
tick: &Tick<L>,
initial_fn: impl FnOnce(&Tick<L>) -> S,
) -> (TickCycleHandle<'a, S>, S)Available on
stageleft_runtime only.Expand description
Creates a stateful cycle with an initial value for use in sliced!.
The initial value is computed from a closure that receives the location for the body of the slice.
The initial value is used on the first iteration, and subsequent iterations receive the value assigned to the mutable binding at the end of the previous iteration.