Skip to content

Commit

Permalink
fix(core): error about provideExperimentalCheckNoChangesForDebug uses…
Browse files Browse the repository at this point in the history
… wrong name

The error about `provideExperimentalCheckNoChangesForDebug` mentions `provideCheckNoChangesForDebug` instead.
  • Loading branch information
cexbrayat committed May 16, 2024
1 parent 23eafb4 commit c2ada68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import {ZONELESS_ENABLED} from './zoneless_scheduling';
*
* @param options Used to configure when the check will execute.
* - `interval` will periodically run exhaustive `checkNoChanges` on application views
* - `useNgZoneOnStable` will us ZoneJS to determine when change detection might have run
* - `useNgZoneOnStable` will use ZoneJS to determine when change detection might have run
* in an application using ZoneJS to drive change detection. When the `NgZone.onStable` would
* have emit, all views attached to the `ApplicationRef` are checked for changes.
* have emitted, all views attached to the `ApplicationRef` are checked for changes.
* - 'exhaustive' means that all views attached to `ApplicationRef` and all the descendants of those views will be
* checked for changes (excluding those subtrees which are detached via `ChangeDetectorRef.detach()`).
* This is useful because the check that runs after regular change detection does not work for components using `ChangeDetectionStrategy.OnPush`.
Expand Down Expand Up @@ -68,7 +68,7 @@ export function provideExperimentalCheckNoChangesForDebug(options: {
!(inject(NgZone) instanceof DebugNgZoneForCheckNoChanges)
) {
throw new Error(
'`provideCheckNoChangesForDebug` with `useNgZoneOnStable` must be after any other provider for `NgZone`.',
'`provideExperimentalCheckNoChangesForDebug` with `useNgZoneOnStable` must be after any other provider for `NgZone`.',
);
}
},
Expand All @@ -87,7 +87,7 @@ export class DebugNgZoneForCheckNoChanges extends NgZone {

constructor(private readonly checkNoChangesMode: CheckNoChangesMode) {
const zonelessEnabled = inject(ZONELESS_ENABLED);
// Use coalsecing to ensure we aren't ever running this check synchronously
// Use coalescing to ensure we aren't ever running this check synchronously
super({
shouldCoalesceEventChangeDetection: true,
shouldCoalesceRunChangeDetection: zonelessEnabled,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/acceptance/change_detection_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ describe('change detection', () => {
expect(comp.viewCheckCount).toEqual(1);
});

describe('provideCheckNoChangesForDebug', () => {
describe('provideExperimentalCheckNoChangesForDebug', () => {
// Needed because tests in this repo patch rAF to be setTimeout
// and coalescing tries to get the native one but fails so
// coalescing will run a timeout in the zone and cause an infinite loop.
Expand Down

0 comments on commit c2ada68

Please sign in to comment.