From a56915073226ff1561c232c56f41cb59c6b010ce Mon Sep 17 00:00:00 2001 From: Stephan Lee Date: Thu, 28 Oct 2021 08:54:50 -0700 Subject: [PATCH] persistent settings: expose OSSSettingsConverter as DI-able (#5387) Currently, OSSSettingsCOnverter is only acquirable by injecting a symbol, SettingsConverter. If we want to compose the converter in a type safe manner, we have to convert the converter to be a generic or compose by injecting an instance of the converter. Here, we have decided to take the latter approach which tends to keep the base implementation simple to reason with without generics. --- .../_data_source/persistent_settings_data_source_module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tensorboard/webapp/persistent_settings/_data_source/persistent_settings_data_source_module.ts b/tensorboard/webapp/persistent_settings/_data_source/persistent_settings_data_source_module.ts index 6eb7d3c3bf2..405bb56938b 100644 --- a/tensorboard/webapp/persistent_settings/_data_source/persistent_settings_data_source_module.ts +++ b/tensorboard/webapp/persistent_settings/_data_source/persistent_settings_data_source_module.ts @@ -29,7 +29,8 @@ import { provide: PersistentSettingsDataSource, useClass: PersistentSettingsDataSourceImpl, }, - {provide: SettingsConverter, useClass: OSSSettingsConverter}, + OSSSettingsConverter, + {provide: SettingsConverter, useExisting: OSSSettingsConverter}, ], }) export class PersistentSettingsDataSourceModule {}