resthub/resthub-backbone-stack — pull request #36 by bmeurant (2012-08-29 23:18:36+00:00)
Title: fix pubsub undelegate problem and add onDispose mehod

Current ``unDelegate`` override remove Pubsub binding and that works fine for bindings declared on ``events`` hash (and so bound immediately after initialize call).

But this does not work with PubSub event registered manually in initialize because ``delegateEvents`` is called after initialized and start by calling ``unDelegateEvents``, removing all PubSub bindings !

New implementation unregister pubsub events on dispose method only.

Also add a hook on dispose to start by calling a default empty ``onDispose`` method that can be called by users to perform actions before effective ``dispose``