-
-
Save Paxa/743270 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wiget = new Class({ | |
Includes: [Class.MethodMutators], | |
something: function () { | |
return new Element('div'); | |
}.mutator('setter'), | |
onComplete: function () { | |
this.hide(); | |
}.mutator('bind'), | |
onSubmit: function () { | |
this.getForm().send(); | |
}.mutator('once') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Чем добавлять еще один класс в стек ради макросов, я бы предпочел сделать отдельный глобальный объект (а-ля something: Macro.setter(function ... ) ). Мутаторы которые модифицируют метод (Memoize, Binds) вообще выбрасывать надо мгновенно.