static-injector 6.2.0 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1615,32 +1615,11 @@ function createEffectFn(node, fn) {
1615
1615
  }
1616
1616
 
1617
1617
  // src/import/util/callback_scheduler.ts
1618
- function scheduleCallbackWithRafRace(callback) {
1619
- let timeoutId;
1620
- let animationFrameId;
1621
- function cleanup() {
1618
+ function scheduleCallbackWithMicrotask(callback) {
1619
+ queueMicrotask(() => callback());
1620
+ return () => {
1622
1621
  callback = noop;
1623
- try {
1624
- if (animationFrameId !== void 0 && typeof cancelAnimationFrame === "function") {
1625
- cancelAnimationFrame(animationFrameId);
1626
- }
1627
- if (timeoutId !== void 0) {
1628
- clearTimeout(timeoutId);
1629
- }
1630
- } catch {
1631
- }
1632
- }
1633
- timeoutId = setTimeout(() => {
1634
- callback();
1635
- cleanup();
1636
- });
1637
- if (typeof requestAnimationFrame === "function") {
1638
- animationFrameId = requestAnimationFrame(() => {
1639
- callback();
1640
- cleanup();
1641
- });
1642
- }
1643
- return () => cleanup();
1622
+ };
1644
1623
  }
1645
1624
 
1646
1625
  // src/import/change_detection/scheduling/zoneless_scheduling_impl.ts
@@ -1649,8 +1628,10 @@ var ChangeDetectionSchedulerImpl = class {
1649
1628
  #rootEffectScheduler = inject2(EffectScheduler);
1650
1629
  cancelScheduledCallback = null;
1651
1630
  notify(source) {
1652
- this.cancelScheduledCallback = scheduleCallbackWithRafRace(() => {
1631
+ this.cancelScheduledCallback = scheduleCallbackWithMicrotask(() => {
1632
+ this.runningTick = true;
1653
1633
  this.#rootEffectScheduler.flush();
1634
+ this.cleanup();
1654
1635
  });
1655
1636
  }
1656
1637
  cleanup() {
@@ -2092,6 +2073,7 @@ export {
2092
2073
  ChangeDetectionSchedulerImpl,
2093
2074
  DecoratorFlags,
2094
2075
  DestroyRef,
2076
+ EffectScheduler,
2095
2077
  EnvironmentInjector,
2096
2078
  ErrorHandler,
2097
2079
  INJECTOR_SCOPE,