rx/presenters

View on GitHub
views/mdc/assets/js/components/events/navigates.js

Summary

Maintainability
A
0 mins
Test Coverage
export class VNavigates {
  constructor(options, params, event, root) {
    this.direction = params.direction;
  }

  call(results) {
    const direction = this.direction;
    return new Promise(function(resolve) {
      results.push({action: 'navigates', statusCode: 200});
      resolve(results);
      switch (direction) {
        case 'back':
          window.history.back();
        case 'forward':
          window.history.forward();
      }
    });
  }
}