set() and push() should return the module #17

Closed
mahonnaise opened this Issue Aug 30, 2012 · 2 comments

Comments

Projects
None yet
3 participants
@mahonnaise
var Foo = Stapes.create().extend({
    ...
}).set({
    ...
});

Looks useful, doesn't it? Well, right now Foo would end up being undefined instead of being something useful.

Other methods which don't return anything else, could do the same. jQuery works like that, too. If the function doesn't return something in particular, it returns this jQuery collection.

[Speaking of which, is there a reason why I can't get those things from the extend block?]

@contra

This comment has been minimized.

Show comment
Hide comment
@contra

contra Oct 12, 2012

The stuff in extend is added to the object as normal properties not as observable ones (like with set) so you can't use .get on them. The difference between the two can get confusing at times. I agree that set should return the base object it gets annoying having to do it on different lines

contra commented Oct 12, 2012

The stuff in extend is added to the object as normal properties not as observable ones (like with set) so you can't use .get on them. The difference between the two can get confusing at times. I agree that set should return the base object it gets annoying having to do it on different lines

hay added a commit that referenced this issue Oct 14, 2012

@hay

This comment has been minimized.

Show comment
Hide comment
@hay

hay Oct 14, 2012

Owner

This issue has been fixed in master. set, remove, push and update now return the module instead of undefined. Thanks for the suggestion!

Owner

hay commented Oct 14, 2012

This issue has been fixed in master. set, remove, push and update now return the module instead of undefined. Thanks for the suggestion!

@hay hay closed this Oct 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment