Skip to content

Commit

Permalink
Add a clear() method to Callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Jul 7, 2022
1 parent b023350 commit d0bf86e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
5 changes: 5 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.

4 changes: 4 additions & 0 deletions srcts/src/utils/callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class Callbacks {
}
}

clear(): void {
this.callbacks = {};
}

count(): number {
return Object.keys(this.callbacks).length;
}
Expand Down
1 change: 1 addition & 0 deletions srcts/types/src/utils/callbacks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ declare class Callbacks {
id: number;
register(fn: () => void, once?: boolean): () => void;
invoke(): void;
clear(): void;
count(): number;
}
export { Callbacks };

0 comments on commit d0bf86e

Please sign in to comment.