class BitsByte extends Array {
    protected _value: number;

    constructor(value: number) {
        super(8);
        this._value = value;
        
        // Assign each flag to an index
        this[0] = (value & 1) == 1;
        this[1] = (value & 2) == 2;
        this[2] = (value & 4) == 4;
        this[3] = (value & 8) == 8;
        this[4] = (value & 16) == 16;
        this[5] = (value & 32) == 32;
        this[6] = (value & 64) == 64;
        this[7] = (value & 128) == 128;
    }

    public get value(): number {
        return this._value;
    }
}

export default BitsByte;
class BitsByte extends Array {
    protected _value: number;

    constructor(value: number) {
        super(8);
        this._value = value;
        
        // Assign each flag to an index
        this[0] = (value & 1) == 1;
        this[1] = (value & 2) == 2;
        this[2] = (value & 4) == 4;
        this[3] = (value & 8) == 8;
        this[4] = (value & 16) == 16;
        this[5] = (value & 32) == 32;
        this[6] = (value & 64) == 64;
        this[7] = (value & 128) == 128;
    }

    public get value(): number {
        this._value = this[0] ? this._value | 1 : this._value;
        this._value = this[1] ? this._value | 2 : this._value;
        this._value = this[2] ? this._value | 4 : this._value;
        this._value = this[3] ? this._value | 8 : this._value;
        this._value = this[4] ? this._value | 16 : this._value;
        this._value = this[5] ? this._value | 32 : this._value;
        this._value = this[6] ? this._value | 64 : this._value;
        this._value = this[7] ? this._value | 128 : this._value;
        return this._value;
    }
}

export default BitsByte;
Fix value not getting updated
Fix value not getting updated
