Register an event listener with automatic cleanup
Optionaloptions: AddEventListenerOptionsCancel a specific animation frame
Clean up all resources (components and global)
Clean up all resources for a specific component
Clean up all global resources
Clear a specific interval
Clear a specific timeout
Register a generic cleanup callback for a component
Register a DOM element that needs cleanup
Optionalcleanup: () => voidRegister a global resource (not tied to a specific component)
Register a React root for cleanup
ResourceManager provides centralized management of resources that need cleanup. This prevents memory leaks by ensuring all resources are properly disposed.