-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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
4c63e6b
commit 21c1e14
Showing
11 changed files
with
171 additions
and
21 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
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