Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To solve that problem we need to use anything other, then dot (".") to separate out internal event namespace, e.g. "\" (as in PHP) . This way "FormManager.WindowManager.Ready" becomes "or ":" (as in http://lostechies.com/derickbailey/2011/09/15/zombies-run-managing-page-transitions-in-backbone-apps/) or maybe even "/".

Our Namespace SeparatorjQuery NamespaceEvent Name
/jQueryNamespaceFormManager/WindowManager/Ready.jQueryNamespace
\jQueryNamespaceFormManager\WindowManager\Ready

...

.jQueryNamespace
:jQueryNamespaceFormManager:WindowManager:Ready.jQueryNamespace

The actual ".namespace" syntax need to be used by code, that listens to that event for easy event listener distinction later on (if we need to remove all in single namespace).

For example listener for string "FormManager\WindowManager\Ready.Uploader" string clearly statesindicates, that it's event listener, that:

  • it listens for "FormManager\WindowManager\Ready" event
  • it is related to Uploader

This way locating event listener created from Uploader would be a breeze.

...