Git Product home page Git Product logo

backbone.advice's People

Contributors

disruptek avatar marcpare avatar rhysbrettbowen avatar stah avatar thirtified avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

backbone.advice's Issues

wrong return-value when mixing in a previously-unknown method name

  myMixin = function() {
    return { foo: function() { return "My foo result" }
  }
  myOtherClass = function() {}.mixin(myMixin); // mumble - point is, it doesn't have 'foo'.
  myOtherClass.foo("some arg");  // returns "some arg"

I expected this to return "My foo result".

Currently, I have to specify 'clobber' for a function name that didn't exist before, because the identity function's return value is returned instead of my function's return value. Surprise! and :(

I'd sort of hope that after would recognize the no-original-method case, and take a shortcut whereby we just create the method with direct reference to the new method. Methods aside, the outcome still seems wrong.

Allow addToObj to accept a function that return an object

First, great project!

It should be interesting if we could pass to addToObj names of prototype functions that return an object, and do the extend with this value, so we could declare for example events as a function(which return an object) as it is usual in backbone for easy inheritance method overloading.

Monkey patch Backbone.extend for better syntactic sugar?

I really like the way Cocktail patches the extend method so that mixin includes can be written far more clearly (imho) in the form;

var MyView = Backbone.View.extend({
  mixins: [MyMixin1, MyMixin2],

  etc...
});

Any chance of similar in Advice?

Tests don't run with latest version of Karma, tests fail on old version of Karma

I just installed Karma to try to get the tests to run and it seems that Karma has changed their config file format, and the tests won't run out of the box.

Steps to reproduce:

sudo npm install -g karma
karma start

I get this error:

ERROR [config]: Config file must export a function!
  module.exports = function(config) {
    config.set({
      // your config
    });
  };

I also did some investigation and tried version 0.8.4 of Karma (the version available around the time the last commit to karma.conf.js was made), and I ran into a problem actually running the test.

Steps to reproduce:

sudo npm install -g phantomjs
sudo npm install -g [email protected]
karma start

I get this error:

PhantomJS 1.9 (Linux) Backbone.Advice should be able to override mixin options should not override only on tha applied constructor FAILED
    expected 2 to equal 3

I don't know if this relates to using the latest version of PhantomJS or not. I have not tried a previous version of PhantomJS to coincide with 0.8.4 of Karma.

Possible 'strict' violations

We are using JSHint and modules with Advice. It all works pretty well; however, JSHint will complain about "possible strict violations." This is basically just hurting my feelings ha.

Have you found a good solution to get around all the linting warnings?

Mixed-in functions can't return values

I'm running into a problem in which I'm mixing two methods into a view, one of which needs a value returned by the other. The problem is, the second method always returns undefined. You can test this pretty easily by running this code in your console:

Backbone.View.mixin({
    callee : function () {
        return "some value";
    },
    caller : function () {
        console.log(this.callee());
    }
});

new Backbone.View().caller(); // undefined

I'm trying to investigate the cause further; I'll update this issue when and if I figure out more.

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.