Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add element and target attribute change callbacks #460

Closed

Commits on Nov 16, 2021

  1. Add element and target attribute change callbacks

    Closes hotwired#445
    
    ---
    
    Implement [attributeChange][] callbacks for both a controller's element
    and its targets.
    
    The `attributeChanged` and `[name]TargetAttributeChanged` callback
    signatures are styled after the Custom Element's
    `attributeChangedCallback`. The target variations accept the target
    element as the first argument, but are otherwise the same.
    
    It feels more appropriate to strive for parity in the interface than it
    is to yield the underlying [MutationRecord][] to call sites.
    
    [attributeChange]: https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks
    [MutationRecord]: https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord
    seanpdoyle committed Nov 16, 2021
    Configuration menu
    Copy the full SHA
    7d80459 View commit details
    Browse the repository at this point in the history