backbone-for-react
Advanced tools
Comparing version 0.1.7 to 0.1.8
16
index.js
@@ -89,2 +89,3 @@ 'use strict'; | ||
if (pcs.length > 0) { | ||
// nested set | ||
var toSet = topLevelValue; | ||
@@ -94,14 +95,15 @@ if (typeof toSet !== "object") { | ||
} | ||
var ptr = toSet; | ||
var lastPtr = ptr; | ||
var lastSetPc = firstPc; | ||
while (pcs.length > 1) { | ||
var nextPc = pcs.shift(); | ||
if (typeof toSet[ nextPc ] !== "object") { | ||
toSet[ nextPc ] = {}; | ||
if (typeof ptr[ nextPc ] !== "object") { | ||
ptr[ nextPc ] = {}; | ||
} else { | ||
ptr[ nextPc ] = _.clone(ptr[ nextPc ]); | ||
} | ||
lastPtr = ptr; | ||
lastSetPc = nextPc; | ||
ptr = toSet[ nextPc ]; | ||
ptr = ptr[ nextPc ]; | ||
} | ||
var lastPc = pcs.shift(); | ||
@@ -108,0 +110,0 @@ |
{ | ||
"name": "backbone-for-react", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "An extension of Backbone that is better suited for use in React", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Backbone for React | ||
[![Build Status](https://travis-ci.org/moodysalem/backbone-for-react.svg)](https://travis-ci.org/moodysalem/backbone-for-react) | ||
[![npm version](https://img.shields.io/npm/v/backbone-for-react.svg)](https://www.npmjs.com/package/backbone-for-react) | ||
An extension of Backbone that supports server side pagination and sorting, provides the ability to easily sort by attributes on the client side, and provides nested getting and setting for models. | ||
27221
8
7
705