Skip to content
This repository has been archived by the owner on May 2, 2019. It is now read-only.

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

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

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

mahonnaise opened this issue Aug 30, 2012 · 2 comments

Comments

@mahonnaise
Copy link

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?]

@yocontra
Copy link

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
Copy link
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 as completed Oct 14, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants