Recent Posts
Recent Comments
CYMAKR
[Backbone.JS] Zombie Views 현상 본문
Backbone.js로 Single Page App 을 만들다 발견한 버그(?)다.
MainView SecondView 가 있다고 치자.
MainView가 render 되고 SecondView로 이동했다가 다시 MainView로 가게되면 render가 되있음에도 불구하고 한번더 render하게된다.
발견한 issue : Backbone 에서 View 왔다갔다할때 events 두번 불러와짐
zombie views 현상
이벤트가 바인드되어있는 상태에서 또 바인드 시키는 현상 ( 이벤트가 중첩됨)
참고링크
https://coderwall.com/p/jrnuiw/don-t-let-your-backbone-js-views-grow-up-to-be-zombies
http://stackoverflow.com/questions/25916009/backbone-zombie-views-good-practice
*Single Page APPs
https://coderwall.com/p/bp1gcq/killing-backbone-zombies-in-single-page-apps
*해결책
앞에다 다음 메소드 선언
Backbone.View.prototype.close = function(){ |
'기술노트 > Backbone.js' 카테고리의 다른 글
단일 페이지 웹 좀비뷰 현상 해결하기 (0) | 2017.02.07 |
---|---|
[Backbone.JS] Zombie Views 현상 (0) | 2017.01.12 |
0 Comments