Skip to content

Commit

Permalink
persistent settings: expose OSSSettingsConverter as DI-able (#5387)
Browse files Browse the repository at this point in the history
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 committed Oct 28, 2021
1 parent 3c384fd commit a569150
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 a569150

Please sign in to comment.