1 import { MAX_DOC_SIZE, MAX_UPDATE_SIZE } from '../Models/Constants'
3 export class DocSizeTracker {
4 private currentSize = 0
6 incrementSize(size: number) {
7 this.currentSize += size
10 canPostUpdateOfSize(size: number) {
11 return this.currentSize + size <= MAX_DOC_SIZE && size <= MAX_UPDATE_SIZE
14 resetWithSize(size: number) {
15 this.currentSize = size