Comments (4)
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.
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.
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.
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)
- Monkey patch Backbone.extend for better syntactic sugar? HOT 2
- Mixed-in functions can't return values HOT 1
- "Backbone.Advice" object availability check. HOT 2
- Add to bower HOT 3
- Possible 'strict
- Possible 'strict' violations HOT 4
- wrong return-value when mixing in a previously-unknown method name HOT 4
- Allow addToObj to accept a function that return an object HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backbone.advice.