@magicx-eng/ai-autocomplete-angular 0.5.7 → 0.5.8
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/esm2020/lib/controller/ai-autocomplete.controller.mjs +16 -11
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs +15 -10
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs +15 -10
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/lib/controller/ai-autocomplete.controller.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -579,16 +579,21 @@ class AIAutocompleteController {
|
|
|
579
579
|
// handed. The core notifies listeners synchronously, and some actions
|
|
580
580
|
// trigger reentrant `store.set` calls (e.g. typing a non-matching char
|
|
581
581
|
// during re-edit makes the core synchronously exit re-edit and kick off a
|
|
582
|
-
// fetch).
|
|
583
|
-
//
|
|
584
|
-
//
|
|
585
|
-
//
|
|
586
|
-
//
|
|
587
|
-
//
|
|
588
|
-
// back to where re-editing started
|
|
589
|
-
//
|
|
590
|
-
//
|
|
591
|
-
//
|
|
582
|
+
// fetch).
|
|
583
|
+
//
|
|
584
|
+
// The core's store used to deliver such a nested set inline and then
|
|
585
|
+
// resume the outer listener loop, so a listener could be handed an older
|
|
586
|
+
// state (still in re-edit) *after* a newer one (re-edit exited) — which
|
|
587
|
+
// resurrected a stale `editingParam` and retriggered the editor's re-edit
|
|
588
|
+
// caret-park, yanking the caret back to where re-editing started. The
|
|
589
|
+
// store now queues notifications and drains them in order, so that
|
|
590
|
+
// out-of-order delivery can no longer happen at the source.
|
|
591
|
+
//
|
|
592
|
+
// Reading `getState()` at emission time is kept as belt-and-braces: it
|
|
593
|
+
// costs nothing (distinctUntilChanged downstream drops the duplicate
|
|
594
|
+
// emissions) and keeps this bridge correct for any future consumer that
|
|
595
|
+
// emits mid-cascade. React needs neither, since it batches renders and
|
|
596
|
+
// gates its caret effects on dependencies.
|
|
592
597
|
this.unsubscribeCore = this.core.subscribe(() => {
|
|
593
598
|
if (!this.isDestroyed)
|
|
594
599
|
this.rawState$.next(this.core.getState());
|