backbone.deepmodel

1.2.4 • Public • Published

Backbone.DeepModel plugin

NPM version Build Status Codecov Status Maintainability Conventional Commits

Sauce Test Status

Super simple and lightweight Backbone.js plugin to handle nested attributes of Backbone.Model.

Please see demo.

Table of Contents

Install

via npm:

npm install backbone backbone.deepmodel

via yarn:

yarn add backbone backbone.deepmodel

or download manually:

Dependencies

Use

import DeepModel from 'backbone.deepmodel'
 
class Person extends DeepModel {
  defaults() {
    return {
      name: {first: '', last: ''},
      pets: []
    }
  }
}
 
const p = new Person()
p.set('name.first', 'Tom')

In browser:

<script src="//unpkg.com/underscore/underscore-min.js"></script>
<script src="//unpkg.com/backbone/backbone-min.js"></script>
<script src="//unpkg.com/backbone.deepmodel/dist/backbone.deepmodel.min.js"></script>

For details, see API Documentation.

Changelog

See here.

Contribute

See here.

License

MIT © ybiquitous

Readme

Keywords

Package Sidebar

Install

npm i backbone.deepmodel

Weekly Downloads

17

Version

1.2.4

License

MIT

Unpacked Size

47.8 kB

Total Files

10

Last publish

Collaborators

  • ybiquitous