import { Application, RouterComponent } from 'rotorjs';

import MainComponent from './mainComponent';
import GreeterComponent from './greeterComponent';

export default class GreeterApplication extends Application {

  constructor(rootElement) {
    super(rootElement);
  }

  start(firstName, lastName) {
    let router = new RouterComponent(this, null, 'router', {

      '': (match, router) => (
        new MainComponent(this, router, 'greeter')
      ),

      'greeter/:firstName/:lastName': (match, router) => (
        new GreeterComponent(this, router, 'greeter', {
          firstName: match.params.firstName,
          lastName: match.params.lastName
        })
      )

    });
    super.start(router, 'router');
  }

};

@@ -723,11 +723,69 @@
 );%0A  %7D%0A%0A
+  stop() %7B%0A    alert('Good bye!');%0A%0A    super.stop();%0A  %7D%0A
 %7D;%0A

add GreeterApplication.stop method