File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
import { EngineInterface } from './interfaces' ;
13
13
import W from './window-proxy' ;
14
14
15
+ const NUM_SKIPPED_FRAMES = 4 ;
16
+
15
17
export class Engine implements EngineInterface {
16
18
private reads : Array < Function > = [ ] ;
17
19
private work : Array < Function > = [ ] ;
18
20
private running : Boolean = false ;
19
- private skipCounter : number = 4 ;
21
+ private skipCounter : number = NUM_SKIPPED_FRAMES ;
20
22
scheduleRead ( callback : Function ) {
21
23
this . reads . unshift ( callback ) ;
22
24
this . run ( ) ;
@@ -29,7 +31,7 @@ export class Engine implements EngineInterface {
29
31
if ( ! this . running ) {
30
32
this . running = true ;
31
33
W . rAF ( ( ) => {
32
- if ( this . skipCounter > 3 ) {
34
+ if ( this . skipCounter > NUM_SKIPPED_FRAMES - 1 ) {
33
35
this . skipCounter = 0 ;
34
36
for ( let i = 0 , rlen = this . reads . length ; i < rlen ; i ++ ) {
35
37
this . reads . pop ( ) ( ) ;
You can’t perform that action at this time.
0 commit comments