How to use the bobril.invalidate function in bobril

To help you get started, we’ve selected a few bobril examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bobril / bobx / index.js View on Github external
if (this.state !== 4 /* Scope */) {
                if (this.state === 2 /* Updating */) {
                    throw new Error("Modifying inputs during updating computed");
                }
                if (this.state === 3 /* Updated */) {
                    this.state = 1 /* NeedRecheck */;
                    var usedBy = this.usedBy;
                    if (usedBy !== undefined) {
                        this.usedBy = undefined;
                        usedBy.forEach(function (comp) {
                            comp.invalidateBy(this.atomId);
                        }, this);
                    }
                    if (this.ctxs !== undefined) {
                        updateNextFrameList.push(this);
                        b.invalidate(bobxRootCtx);
                    }
                }
            }
            this.freeUsings();
        }
    };
    ComputedImpl.prototype.freeUsings = function () {
github bobril / bobx / index.js View on Github external
function setPartialResults() {
    var ctx = b.getCurrentCtx();
    if (ctx !== undefined) {
        if (isIBobxComputed(ctx)) {
            ctx.partialResults = true;
        }
        else {
            b.invalidate(ctx);
        }
    }
    outsideOfComputedPartialResults = true;
}
function gotPartialResults() {
github Bobris / bobril-build / web / communication.ts View on Github external
export function reconnect() {
    s.disconnected = false;
    c.connect();
    b.invalidate();
}
github bobril / bobx / index.js View on Github external
function interrupted() {
    if (alreadyInterrupted)
        return true;
    var ctx = b.getCurrentCtx();
    if (firstInterruptibleCtx === undefined)
        firstInterruptibleCtx = ctx;
    if (gotPartialResults()) {
        return true;
    }
    if (!haveTimeBudget()) {
        if (ctx === firstInterruptibleCtx) {
            return false;
        }
        if (ctx !== undefined && !isIBobxComputed(ctx)) {
            b.invalidate(ctx);
        }
        alreadyInterrupted = true;
        firstInterruptibleCtx = undefined;
        return true;
    }
    return false;
}
exports.interrupted = interrupted;
github bobril / bobx / index.ts View on Github external
schedule(): void {
        if (updateNextFrameList.length == 0) b.invalidate(bobxRootCtx);
        updateNextFrameList.push(this);
    }
github bobril / bobx / index.ts View on Github external
function setPartialResults(): void {
    const ctx = b.getCurrentCtx() as IBobxCallerCtx;
    if (ctx !== undefined) {
        if (isIBobxComputed(ctx)) {
            ctx.partialResults = true;
        } else {
            b.invalidate(ctx);
        }
    }
    outsideOfComputedPartialResults = true;
}
github keeema / bobrilstrap / example / liveComponents / collapse.ts View on Github external
function toggleExpandItem(item: number) {
  expanded = expanded === item ? 0 : item;
  b.invalidate();
}
github bobril / bobril-m / src / menuItem.ts View on Github external
function handleRequestClose(ctx: IMenuItemCtx) {
    ctx.open = false;
    b.invalidate(ctx);
};
github bobril / bobril-m / src / menu.ts View on Github external
for (let i = 0; i < selectable.length; i++) {
                    if (this.selected === selectable[i]) {
                        found = true;
                        this.selectedIndex = i;
                        break;
                    }
                }
            if (!found) this.selected = undefined;
            if (this.selected == undefined) {
                this.selected = selectable[this.selectedIndex];
            }
            for (let i = 0; i < selectable.length; i++) {
                let c = selectable[i];
                if (c.focused != (focused && i == this.selectedIndex)) {
                    c.focused = !c.focused;
                    b.invalidate(c);
                }
            }
        } else {
            this.selectedIndex = -1;
            this.selected = undefined;
        }
    }
github bobril / bobril-m / src / toggle.ts View on Github external
onKeyDown(ctx: IToggleCtx, ev: b.IKeyDownUpEvent): boolean {
        if (ev.which === 32 && !ctx.data.disabled && ctx.focusFromKeyboard) {
            ctx.down = true;
            b.invalidate(ctx);
            return true;
        }
        if (ev.which === 13 && !ctx.data.disabled && ctx.focusFromKeyboard) {
            let a = ctx.data.action;
            if (a) a();
            return true;
        }
        return false;
    },
    onKeyUp(ctx: IToggleCtx, ev: b.IKeyDownUpEvent): boolean {