euv-core 0.3.8

A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly.
Documentation
use crate::*;

/// Implementation of ComponentContext construction.
impl ComponentContext {
    /// Creates a new empty component context.
    pub fn new() -> Self {
        let mut ctx: ComponentContext = ComponentContext::default();
        ctx.set_hooks(Vec::new());
        ctx.set_hook_index(0_usize);
        ctx
    }
}

/// Implementation of component context lifecycle and utility methods.
impl ComponentContext {
    /// Resets the hook index for a new render cycle.
    pub fn reset_hook_index(&mut self) {
        self.set_hook_index(0_usize);
    }
}