Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    backbone-deepextendpublic

    backbone-deepextend

    A Backbone extend implementation that merges properties rather than overrides". Useful for inheritting defaults and other attributes which are objects on a model.

    Travis build status Code Climate Test Coverage Dependency Status devDependency Status

    This module should be imported before any models that need this functionality are derived as <Class>.extend is written on all objects on creation time.

    require('backbone-deepextend');
     
    var Model = Backbone.Model.extend({
        defaults: {
            a: 1
        }
    }).extend({
        defaults: {
            b: 2
        }
    })
     
    var model = new Model;
    model.get('a') // => 1
    model.get('b') // => 2

    Keywords

    none

    install

    npm i backbone-deepextend

    Downloadsweekly downloads

    16

    version

    1.0.3

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar
    • avatar