Components - llorsat/wonkajs GitHub Wiki

For a minute think that you want to call two views with name "Result", but one will be used to show an users list and another books list. The easiest is write:

window.UsersResult = Bb.View.extend({...});
window.BooksResult = Bb.View.extend({...});

But wonka give priority to modularize,so you can simply create two applications:

$ wonkajs project users
$ wonkajs project books

And write on views.js inside each application, a view called "Result":

...
  views.Result = Bb.View.extend({...});
...

And if we have a third application and we want to call the view Result on each application, we could do:

new books.views.Result();
new users.views.Result();

And if you want to call it inside the same views.js, simply:

new views.Result();

This feature is available thanks to namespace declaration on each application created inside your project, the namespace declaration for your application is on init.js file, so don't remove the file or their content.