const DEFAULT = 'Base' ; const CUSTOM = 'Nflx' ; param classDir param className export async function loadServiceClass < T > ( classDir , className ) { console . log ( 'loading class...' ) ; let classObj ; try { classObj = await import ( `../services/${ classDir }/${ CUSTOM }${ className }` ) ; } catch ( err ) { console . log ( err . message ) ; try { classObj = await import ( `../services/${ classDir }/${ DEFAULT }${ className }` ) ; } catch ( err ) { console . log ( err . message ) ; console . error ( `Failed to load class ${ className } in dir ${ classDir }` ) ; } } return classObj . default ; }