Skip to content

Commit

Permalink
persistent settings: expose OSSSettingsConverter as DI-able (tensorfl…
Browse files Browse the repository at this point in the history
…ow#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.
  • Loading branch information
stephanwlee authored and dna2github committed May 1, 2023
1 parent 13eb428 commit 49d3ecf
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import {
provide: PersistentSettingsDataSource,
useClass: PersistentSettingsDataSourceImpl,
},
{provide: SettingsConverter, useClass: OSSSettingsConverter},
OSSSettingsConverter,
{provide: SettingsConverter, useExisting: OSSSettingsConverter},
],
})
export class PersistentSettingsDataSourceModule {}

0 comments on commit 49d3ecf

Please sign in to comment.