(function() {
  var SpellCheckTask, Task,
    __slice = [].slice;

  Task = require('atom').Task;

  module.exports = SpellCheckTask = (function() {
    SpellCheckTask.activeViews = 0;

    function SpellCheckTask() {
      var _base;
      if ((_base = this.constructor).task == null) {
        _base.task = new Task(require.resolve('./spell-check-handler'));
      }
      this.constructor.activeViews++;
    }

    SpellCheckTask.prototype.terminate = function() {
      var _ref;
      if (--this.constructor.activeViews === 0) {
        if ((_ref = this.constructor.task) != null) {
          _ref.terminate();
        }
        return this.constructor.task = null;
      }
    };

    SpellCheckTask.prototype.start = function() {
      var args, _ref;
      args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      return (_ref = this.constructor.task) != null ? _ref.start.apply(_ref, args) : void 0;
    };

    return SpellCheckTask;

  })();

}).call(this);
