Git Product home page Git Product logo

Comments (4)

rhysbrettbowen avatar rhysbrettbowen commented on July 19, 2024

tried test.html and I'm getting the mixin options error as well. May be an unrelated to the karma running but I'll get that fixed first and give it a go

from backbone.advice.

rhysbrettbowen avatar rhysbrettbowen commented on July 19, 2024

Looks like this is harder to fix than first thought. Problem is the function is run with the object reference when it is first put on, meaning that adding in a new reference for further extended objects are just not passed in. Allowing extended objects to override their parent's object is an option but a dangerous one.

I'd recommend using https://github.com/rhysbrettbowen/Backbone.AdviceFactory which defers the running of mixins until instantiation which solves the problem. I'll have a think about it and see if there is a solution for advice.

from backbone.advice.

rhysbrettbowen avatar rhysbrettbowen commented on July 19, 2024

another option is instead of using the options in a function (first argument) you should be able to get to the options with this.constructor.mixedOptions

from backbone.advice.

rhysbrettbowen avatar rhysbrettbowen commented on July 19, 2024

unfortunately it's just impossible to fix, I think using the factory is the right way to go about it as if we're redefining how to create objects we may as well redefine how they are instantiated.

from backbone.advice.

Related Issues (9)

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.