Pattern to manage views in backbone

后端 未结 4 1683
误落风尘
误落风尘 2021-01-30 09:34

Coming from GWT, Backbone seems to miss a built-in solution on how to handle the life-cycle of a view. In GWT, every activity, which is more or less the equivalent to a View in

4条回答
  •  灰色年华
    2021-01-30 10:05

    you are right, there is no build in solution to that (yet).

    however it is of course possible to extend backbone to provide this functionality, Derick Bailey has written a blog post about this recently,

    take a look here: http://lostechies.com/derickbailey/2011/09/15/zombies-run-managing-page-transitions-in-backbone-apps/

    this is by no means the holy grail, you are free to implement as you wish, but it is a very straight forward approach, for handling zombie views, now you still need to take care of other creatures crawling in your memory, but this is a start with the views at least!

提交回复
热议问题