@eui/core 19.0.0-next.16 → 19.0.0-next.17

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.
@@ -1955,20 +1955,13 @@ class I18nLoader {
1955
1955
  * @param lang the resource language to load
1956
1956
  * @returns Observable<any>
1957
1957
  */
1958
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1959
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1960
1958
  loadResource(resource, lang) {
1961
1959
  // the path to the resource
1962
1960
  const path = resource.getPath(lang);
1963
1961
  // load the translations from the path
1964
1962
  return this.http.get(path).pipe(
1965
1963
  // preprocess the translations using the resource compiler
1966
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1967
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1968
- map((translations) => resource.compileTranslations(translations, lang)),
1969
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1970
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1971
- map((translations) => {
1964
+ map((translations) => resource.compileTranslations(translations, lang)), map((translations) => {
1972
1965
  // resource loaded properly, send a info message
1973
1966
  this.logger?.info(`I18n resource loaded from path ${path}`);
1974
1967
  // return the translations
@@ -2058,8 +2051,10 @@ class I18nService extends EuiLazyService {
2058
2051
  // Use `runInInjectionContext` to ensure `toObservable` is within Angular injection context
2059
2052
  return runInInjectionContext(this.injector, () => toObservable(computedState).pipe(takeUntil(this.subNotifier), distinctUntilChanged((x, y) => isEqual(x, y))));
2060
2053
  }
2061
- updateState(state) {
2062
- this.updateHTMLDOMLang(state.activeLang);
2054
+ updateState(state, reducer) {
2055
+ if (state.activeLang) {
2056
+ this.updateHTMLDOMLang(state.activeLang);
2057
+ }
2063
2058
  this.state.update(currentState => super.deepMerge(currentState, { ...state }));
2064
2059
  }
2065
2060
  /**