
ray.js is a library that checks the DOM for html components and execute its related js counterpart
Ray.js is a powerful JavaScript library designed to streamline the interaction between HTML components and their corresponding JavaScript functionalities. By utilizing the data-ray-component attribute, developers can easily manage behavior linked to specific DOM elements, providing a seamless way to integrate dynamic features into web applications. This library not only simplifies the execution of JavaScript based on HTML attributes but also enhances the maintainability of code with a clean and organized approach.
With features such as JSON parameter injection and an event bus system, Ray.js offers a flexible environment for developing responsive web components. Whether you are managing simple UI elements or complex interactive features, Ray.js facilitates smooth execution and synchronization between your HTML and JavaScript, making it an excellent choice for modern web development.
DOM Component Detection: Automatically checks for elements with the data-ray-component attribute and executes the corresponding JavaScript when the DOM is ready.
JSON Parameter Injection: Utilize the data-ray-params attribute to pass data in JSON format, allowing for dynamic and flexible component behavior.
Shared Data Object: Each component execution injects a shared data object, providing references to the triggering DOM element, the event bus, and any parameters passed.
Event Bus System: Easily trigger and listen to events using the bus, allowing for better communication between components and a more organized architecture.
Error Handling: Integrated error management with the ability to catch and respond to errors through the Ray.Events.ERROR event.
Command Execution: Send commands to the ray.js bus to discover and execute new components efficiently.
Rich Example Library: Access to a wide range of complex example implementations in the samples directory for quick learning and inspiration.
