Skip to content

Latest commit

 

History

History
34 lines (20 loc) · 511 Bytes

render-return.md

File metadata and controls

34 lines (20 loc) · 511 Bytes

Enforces render function to always return this (render-return)

Returning this from within render function is considered best practice in Backbone.

Rule Details

The following patterns are considered warnings:

Backbone.View.extend({
    render: function() {

    }
});

The following patterns are not warnings:

Backbone.View.extend({
    render: function() {
        return this;
    }
});

Further Reading

BackboneJS Documentation