...

/

Implement a Config-Driven Notification Service Factory

Implement a Config-Driven Notification Service Factory

Create a notification factory that builds the correct service (email, SMS, or push) from a nested config object.

We'll cover the following...

Problem statement

Your app supports multiple notification channels—Email, SMS, and Push. The active channel is defined in a nested config object like:

const config = {
notifications: {
channel: 'sms'
}
}

The team wants to support swappable notification ...