Code Monkey home page Code Monkey logo

Comments (6)

afeld avatar afeld commented on June 15, 2024

Right, the inconsistency is definitely not good. If an entire nested object is unset, do you think each attribute needs to show up in the changedAttributes, or just the top-level one? What about when something is removed from an array? Not obvious how those would be reflected...

Anyway, created a new branch (missing-changedattrs) with your test.

from backbone-nested.

trevorquinn avatar trevorquinn commented on June 15, 2024

For every change, including unset, I think it's useful to have all attributes in the affected branch (every level), reflected in changedAttributes, not just the top-level one.

For item removal from an array, I guess I would do the same. I'm not sure if the removed array item would also show up in changedAttributes - I would follow whatever Backbone.js does for an ordinary removed attribute.

from backbone-nested.

afeld avatar afeld commented on June 15, 2024

Well, the difference is when a property is unset() from an object, it can appear in changedAttributes as undefined (see the Backbone test)... when remove() is called on an array, I can't think of a good way for it to show up there, since that index will now have whatever element was next.

I'll work on resolving the inconsistency, though.

from backbone-nested.

borestad avatar borestad commented on June 15, 2024

Hi.
Really appriciate your work with NestedModel.
Just wanted to check if this is somthing that you're working atm on since the tests are failing? :-) Or is there something that I can do to help?

from backbone-nested.

afeld avatar afeld commented on June 15, 2024

@borestad haven't gotten a chance to tackle it. if you want to give it a shot - which would be much appreciated - just post here and send a pull request. otherwise, will get to it asap.

from backbone-nested.

afeld avatar afeld commented on June 15, 2024

Fixed by #48.

from backbone-nested.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.