I developed a specific interface named IPreferences
. Here's how it's constructed:
export interface IPreferences {
genres: Genres[],
singers: Singer[],
volume: number
}
As I provide users with the ability to modify their preferences by updating one or more fields, I introduced another interface called IPreferenceUpdateRequest
which is structured like this:
export interface IPreferencesUpdateRequest {
genres?: Genres[],
singers?: Singer[],
volume?: number
}
However, I've realized that having two very similar interfaces is not an efficient approach.
Is there a way for me to handle this situation while adhering to the principle of DRY ?