일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Google Map
- Android
- MFC
- 전자정부프레임워크
- JSON
- WebLogic
- MySQL
- node.js
- rowspan
- swingx
- ibsheet
- sencha touch
- Spring
- 선택적조인
- Ajax
- Struts
- oracle
- dock
- PLSQL
- JDOM
- iBATIS
- jsr 296
- jQuery
- appspresso
- tomcat
- PHP
- phonegap
- Eclipse
- GPS
- 가우스
Archives
- Today
- Total
Where The Streets Have No Name
Event.observeMethod: More AOP for JavaScript 본문
http://___.constantology.com/observe_method/
Christos Constandinou has created Event.observeMethod ,a library that gives you a way of adding event listeners to methods inan object and running other methods before, around and/ or after themethod you are listening to.
The code itself is small, based on Prototype, and only 49 lines (1.8kb), uncompressed.
JAVASCRIPT:
- Event.observeMethod( window, 'myNewFunc', myBeforeFunc, Event.BEFORE );
- Event.observeMethod( Friend, "initialize", this.addBirthday.bind( this ) );
Dojo has allowed you to do this kind of thing in itsconnect() model. You tend to wonder how often people need thisgranularity versus just being able to attach normal events.
It makes a lot of sense in large scale applications, but maybe not your JS hacking?