• 
      

    Add accessors for common class attribute lookups.

    Review Request #13552 — Created Feb. 18, 2024 and submitted

    Information

    Spina
    master

    Reviewers

    Backbone's design allows for both static (unchanging, not ES6 static)
    and dynamic (function-based) values for many class attributes. To safely
    query these, callers are expected to access these attributes using
    _.result(obj, 'attrname'), which doesn't feel natural with ES6
    classes.

    This change introduces accessors for these attributes. You can now fetch
    myModel.getURL() or myView.getTagName(), for example, instead of
    _.result(myModel, 'url') or _.result(myView, 'tagName').

    These are type-safe as well.

    Unit tests pass.

    Summary ID
    Add accessors for common class attribute lookups.
    Backbone's design allows for both static (unchanging, not ES6 static) and dynamic (function-based) values for many class attributes. To safely query these, callers are expected to access these attributes using `_.result(obj, 'attrname')`, which doesn't feel natural with ES6 classes. This change introduces accessors for these attributes. You can now fetch `myModel.getURL()` or `myView.getTagName()`, for example, instead of `_.result(myModel, 'url')` or `_.result(myView, 'tagName')`. These are type-safe as well.
    5c9ef77e7a1c80b17813f6aa5efbf98125e2df21
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (aa31de0)