November 2019
Beginner
804 pages
20h 1m
English
As we've explained, the service layer is already implemented, but InversifyJS hasn't been fully configured yet. Let's do it now and make sure that we can use dependency injection to get an instance of the MusicService service.
First off, add a few symbols to the src/ioc/types.ts file:
export const TYPES = {
MUSIC_SERVICE: Symbol('MUSIC_SERVICE'),
MUSIXMATCH_BASE_URL: Symbol('MUSIXMATCH_BASE_URL'),
AXIOS_INSTANCE: Symbol('AXIOS-INSTANCE'),
};
We'll use MUSIC_SERVICE Symbol as the unique token for the music service.
Next, adapt the MusicService implementation in src/services/music-service.ts to introduce the necessary InversifyJS decorators:
Read now
Unlock full access