Created
July 3, 2013 14:31
-
-
Save rhysbrettbowen/5918435 to your computer and use it in GitHub Desktop.
AdviceFactory interface choices
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
// put in name: | |
Factory.register('MovableBoard', { | |
'base': 'WidgetBoard', | |
'widget': WidgetContainer, | |
'enterDocument.override': fn(){ | |
}, | |
'asdd.around': fn() { | |
}, | |
'onClick': fn() { | |
} | |
}); | |
// put on Function prototype | |
Factory.register('MovableBoard', { | |
'base': 'WidgetBoard', | |
'widget': WidgetContainer, | |
'enterDocument': (fn(){ | |
}).override(), | |
'asdd': (fn() { | |
}).around(), | |
'onClick': fn() { | |
} | |
}); | |
// Put in a function | |
Factory.register('MovableBoard', { | |
'base': 'WidgetBoard', | |
'widget': WidgetContainer, | |
'enterDocument': Factory.override(fn(){ | |
}), | |
'asdd': Factory.around(fn() { | |
}), | |
'onClick': fn() { | |
} | |
}); | |
// Put in separate objects | |
Factory.register('MovableBoard', { | |
'base': 'WidgetBoard', | |
'widget': WidgetContainer, | |
override: { | |
'enterDocument': fn(){ | |
} | |
}, | |
around: { | |
'asdd': fn() { | |
} | |
}, | |
'onClick': fn() { | |
} | |
}); | |
// define in another object | |
Factory.register('MovableBoard', { | |
'base': 'WidgetBoard', | |
'widget': WidgetContainer, | |
'enterDocument': fn(){ | |
}, | |
'asdd': fn() { | |
}, | |
'onClick': fn() { | |
}, | |
define: { | |
enterDocument: 'override', | |
asdd: 'around' | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment