@tstdl/base 0.85.12 → 0.85.13
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/package.json +1 -1
- package/rxjs/timing.js +4 -1
- package/text/dynamic-text.model.js +2 -1
package/package.json
CHANGED
package/rxjs/timing.js
CHANGED
|
@@ -41,7 +41,10 @@ const singleNextTick$ = singleCallback((callback) => process.nextTick(callback))
|
|
|
41
41
|
const nextTick$ = recursiveCallback((callback) => process.nextTick(callback));
|
|
42
42
|
function singleCallback(scheduler, canceller) {
|
|
43
43
|
return new import_rxjs.Observable((subscriber) => {
|
|
44
|
-
const handle = scheduler((value) =>
|
|
44
|
+
const handle = scheduler((value) => {
|
|
45
|
+
subscriber.next(value);
|
|
46
|
+
subscriber.complete();
|
|
47
|
+
});
|
|
45
48
|
return () => canceller?.(handle);
|
|
46
49
|
});
|
|
47
50
|
}
|
|
@@ -31,6 +31,7 @@ __export(dynamic_text_model_exports, {
|
|
|
31
31
|
module.exports = __toCommonJS(dynamic_text_model_exports);
|
|
32
32
|
var import_rxjs = require("rxjs");
|
|
33
33
|
var import_container = require("../container/index.js");
|
|
34
|
+
var import_timing = require("../rxjs/timing.js");
|
|
34
35
|
var import_api = require("../signals/api.js");
|
|
35
36
|
var import_switch_map = require("../signals/switch-map.js");
|
|
36
37
|
var import_type_guards = require("../utils/type-guards.js");
|
|
@@ -38,7 +39,7 @@ var import_localization_service = require("./localization.service.js");
|
|
|
38
39
|
const missingLocalizationKeyText = "[MISSING LOCALIZATION KEY]";
|
|
39
40
|
function resolveDynamicText(text, localizationService) {
|
|
40
41
|
const resolvedLocalizationService = localizationService ?? import_container.container.resolve(import_localization_service.LocalizationService);
|
|
41
|
-
const localizableTextSignal = (0, import_api.isSignal)(text) ? text : (0, import_rxjs.isObservable)(text) ? (0, import_api.toSignal)(text, { initialValue: missingLocalizationKeyText }) : (0, import_api.computed)(() => text);
|
|
42
|
+
const localizableTextSignal = (0, import_api.isSignal)(text) ? text : (0, import_rxjs.isObservable)(text) ? (0, import_api.toSignal)(text.pipe((0, import_rxjs.delayWhen)(() => import_timing.microtask$)), { initialValue: missingLocalizationKeyText }) : (0, import_api.computed)(() => text);
|
|
42
43
|
return (0, import_switch_map.switchMap)(() => {
|
|
43
44
|
const localizableText = localizableTextSignal();
|
|
44
45
|
return (0, import_type_guards.isString)(localizableText) ? (0, import_api.computed)(() => localizableText) : resolvedLocalizationService.localize(localizableText);
|