Skip to content

Instantly share code, notes, and snippets.

@Paxa
Forked from rwz/gist:743264
Created December 16, 2010 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Paxa/743270 to your computer and use it in GitHub Desktop.
Save Paxa/743270 to your computer and use it in GitHub Desktop.
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')
});
@Inviz
Copy link

Inviz commented Dec 16, 2010

Чем добавлять еще один класс в стек ради макросов, я бы предпочел сделать отдельный глобальный объект (а-ля something: Macro.setter(function ... ) ). Мутаторы которые модифицируют метод (Memoize, Binds) вообще выбрасывать надо мгновенно.

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