"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.PaginationModeOffset = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _mobx = require("mobx");
class PaginationModeOffset {
  constructor(params) {
    (0, _defineProperty2.default)(this, "collection", void 0);
    this.collection = params.collection;
    (0, _mobx.makeObservable)(this, {
      fetchedLastPage: _mobx.computed
    });
  }
  get fetchedLastPage() {
    const {
      totalPages,
      result: {
        pages
      }
    } = this.collection;
    return pages.length >= totalPages;
  }
  setCursor() {}
  get id() {
    return PaginationModeOffset.id;
  }
}
exports.PaginationModeOffset = PaginationModeOffset;
(0, _defineProperty2.default)(PaginationModeOffset, "id", 'offset');
//# sourceMappingURL=PaginationModeOffset.js.map