Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a flag in bootstrap to enable coalesce event change detecti…
- Loading branch information
1 parent
c5894e0
commit 44623a1
Showing
9 changed files
with
146 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
import {global} from './global'; | ||
|
||
export function getNativeRequestAnimationFrame() { | ||
let nativeRequestAnimationFrame: (callback: FrameRequestCallback) => number = | ||
global['requestAnimationFrame']; | ||
let nativeCancelAnimationFrame: (handle: number) => void = global['cancelAnimationFrame']; | ||
if (typeof Zone !== 'undefined' && nativeRequestAnimationFrame && nativeCancelAnimationFrame) { | ||
// use unpatched version of requestAnimationFrame(native delegate) if possible | ||
// to avoid another Change detection | ||
const unpatchedRequestAnimationFrame = | ||
(nativeRequestAnimationFrame as any)[(Zone as any).__symbol__('OriginalDelegate')]; | ||
if (unpatchedRequestAnimationFrame) { | ||
nativeRequestAnimationFrame = unpatchedRequestAnimationFrame; | ||
} | ||
const unpatchedCancelAnimationFrame = | ||
(nativeCancelAnimationFrame as any)[(Zone as any).__symbol__('OriginalDelegate')]; | ||
if (unpatchedCancelAnimationFrame) { | ||
nativeCancelAnimationFrame = unpatchedCancelAnimationFrame; | ||
} | ||
} | ||
return {nativeRequestAnimationFrame, nativeCancelAnimationFrame}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters