Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions inst/www/shared/shiny.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions inst/www/shared/shiny.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/www/shared/shiny.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inst/www/shared/shiny.min.js.map

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions srcts/src/shiny/shinyapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@

$allowReconnect: boolean | "force" = false;

private _conditionalsUpdateScheduled = false;

Check failure on line 158 in srcts/src/shiny/shinyapp.ts

View workflow job for this annotation

GitHub Actions / routine / routine

Class Property name `_conditionalsUpdateScheduled` must match one of the following formats: camelCase

constructor() {
this._init();
}
Expand Down Expand Up @@ -579,6 +581,15 @@
}

$updateConditionals(): void {
if (this._conditionalsUpdateScheduled) return;
this._conditionalsUpdateScheduled = true;
requestAnimationFrame(() => {
this._conditionalsUpdateScheduled = false;
this._doUpdateConditionals();
});
}

private _doUpdateConditionals(): void {
// @ts-expect-error; TODO-barret; Could this be transformed into `.trigger(TYPE)`?
$(document).trigger({
type: "shiny:conditional",
Expand Down
2 changes: 2 additions & 0 deletions srcts/types/src/shiny/shinyapp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ declare class ShinyApp {
};
$nextRequestId: number;
$allowReconnect: boolean | "force";
private _conditionalsUpdateScheduled;
constructor();
connect(initialInput: InputValues): void;
isConnected(): boolean;
Expand All @@ -77,6 +78,7 @@ declare class ShinyApp {
private _narrowScopeComponent;
private _narrowScope;
$updateConditionals(): void;
private _doUpdateConditionals;
dispatchMessage(data: ArrayBufferLike | string): Promise<void>;
private _sendMessagesToHandlers;
private _updateProgress;
Expand Down
Loading