Skip to content

Commit 2b6f78f

Browse files
author
Xiaoyu Yin
committed
[screenshotter] add comments
1 parent 382f49f commit 2b6f78f

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sigmacomputing/plugin",
3-
"version": "1.0.3",
3+
"version": "1.0.5",
44
"description": "Sigma Computing Plugin Client API",
55
"license": "MIT",
66
"homepage": "https://github.com/sigmacomputing/plugin",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ export * from './types';
22
export * from './react';
33
export * from './client';
44

5-
export * from './utils/requestAnimationFramePolyfill';
5+
export {polyfillRequestAnimationFrame} from './utils/polyfillRequestAnimationFrame';
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* requestAnimationFrame() calls are paused in most browsers when running in background tabs or hidden <iframe>s in order to improve performance and battery life
3+
*
4+
* @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
5+
* @param w Window Object
6+
*/
7+
export function polyfillRequestAnimationFrame(w: Window) {
8+
if ('requestAnimationFrame' in w) {
9+
w.requestAnimationFrame = cb => w.setTimeout(cb, 1000 / 60);
10+
w.cancelAnimationFrame = id => w.clearTimeout(id);
11+
}
12+
}

src/utils/requestAnimationFramePolyfill.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)