📄️ xnew
xnew is the core function of the library that creates interactive components and manages their lifecycle. This comprehensive guide covers all aspects of using xnew effectively.
📄️ xnew.nest
xnew.nest creates a new HTML element as a child of the current element and shifts the context to that new element. After calling xnew.nest, subsequent operations work on the newly created element instead of the original parent.
📄️ xnew.extend
xnew.extend adds functionality from another component to the current unit without creating a new element. This enables powerful composition patterns by mixing multiple behaviors into a single component.
📄️ xnew.timeout
xnew.timeout creates a delayed execution timer that runs a callback function after a specified delay. Unlike regular setTimeout, callbacks execute within the current xnew scope, providing automatic cleanup and context preservation.
📄️ xnew.interval
xnew.interval creates a repeating timer that executes a callback function at regular intervals. Unlike regular setInterval, callbacks execute within the current xnew scope, providing automatic cleanup and context preservation.
📄️ xnew.transition
xnew.transition creates smooth animations by executing a callback function repeatedly over a specified duration. The callback receives a progress value that transitions from 0 to 1, which can be used to animate properties smoothly.
📄️ xnew.promise
xnew.promise wraps a Promise to ensure its handlers (then, catch) execute within the current xnew scope. This provides automatic cleanup and proper context management for asynchronous operations.
📄️ xnew.fetch
xnew.fetch is a wrapper around the standard fetch API that executes within the current xnew scope. It provides automatic cleanup, proper context management, and seamless integration with other xnew functions.
📄️ xnew.context
xnew.context provides a way to share data across nested units through a hierarchical context system. Child units can access context values from their ancestors, and can override them locally without affecting parent values.
📄️ xnew.find
xnew.find retrieves all active units that were created with a specific component function. This is useful for managing, updating, or coordinating multiple instances of the same component type.
📄️ xnew.append
xnew.append dynamically adds child components to existing units. You can append to a specific unit or to all units of a particular component type. This enables powerful patterns for extending functionality after component creation.
📄️ xnew.audio
synthesizer