Skip to content
This repository has been archived by the owner. 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

@mahonnaise mahonnaise commented Aug 30, 2012

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
Copy link

@contra 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
Copy link
Owner

@hay 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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.