import { Injectable } from '@angular/core';
import { BehaviorSubject } from "rxjs";

@Injectable({ providedIn: 'root' })
export class JumpTableService {

    tableRefresh: boolean;
    _tableRefreshBS = new BehaviorSubject<boolean>(false);

    jumpRefresh: boolean;
    _jumpRefreshBS = new BehaviorSubject<boolean>(false);

    constructor() {
        this.tableRefresh = false;;
        this.jumpRefresh = false;;

        //this._tableRefreshBS.next(this.tableRefresh);
        //this._jumpRefreshBS.next(this.jumpRefresh);
    }

    updateTableRefresh(val: boolean) {
        this.tableRefresh = val;
        this._tableRefreshBS.next(this.tableRefresh);
    }

    updateJumpRefresh(val: boolean) {
        this.jumpRefresh = val;
        this._jumpRefreshBS.next(this.jumpRefresh);
    }

}