Skip to content

Commit

Permalink
refactor: cleanup client exports
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Aug 3, 2023
1 parent a3fa8a1 commit 1aa23c6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
7 changes: 4 additions & 3 deletions projects/movies/src/app/data-access/images/image-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { IMAGE_LOADER, ImageLoaderConfig } from '@angular/common';
import { W154H205 } from './image-sizes';
import { MY_LIST_FALLBACK, POSTER_FALLBACK } from '../../constants';

const baseUrl = `https://image.tmdb.org/t/p/w`;

export const provideTmdbImageLoader = () => {
export const provideTmdbImageLoader = (
cfg: { baseUrl: string } = { baseUrl: `https://image.tmdb.org/t/p/w` }
) => {
const { baseUrl } = cfg;
return {
provide: IMAGE_LOADER,
useValue: (config: ImageLoaderConfig) => {
Expand Down
13 changes: 8 additions & 5 deletions projects/movies/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import {bootstrapApplication} from '@angular/platform-browser';
import {AppStandaloneComponent} from './app/app.component.standalone';
import {ApplicationConfig} from '@angular/core';
import {mergeBaseConfig} from './app/app.base.config';
import { bootstrapApplication } from '@angular/platform-browser';
import { AppStandaloneComponent } from './app/app.component.standalone';
import { ApplicationConfig } from '@angular/core';
import { mergeBaseConfig } from './app/app.base.config';

const bootstrap = (config: ApplicationConfig = {providers: []}) =>
const bootstrap = (config: ApplicationConfig = { providers: [] }) =>
bootstrapApplication(AppStandaloneComponent, mergeBaseConfig(config));

export default bootstrap;
export { tmdbContentTypeInterceptor } from './app/data-access/api/tmdbContentTypeInterceptor';
export { tmdbReadAccessInterceptor } from './app/auth/tmdb-http-interceptor.feature';
export { provideTmdbImageLoader } from './app/data-access/images/image-loader';
10 changes: 6 additions & 4 deletions projects/ng-universal-express/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { provideServerRendering } from '@angular/platform-server';
import { provideFastSVG } from '@push-based/ngx-fast-svg';
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import { provideISR } from 'ngx-isr';
import { IconLoadStrategySsr } from './icon-load.ssr.strategy';
import { tmdbContentTypeInterceptor } from '../../../movies/src/app/data-access/api/tmdbContentTypeInterceptor';
import { tmdbReadAccessInterceptor } from '../../../movies/src/app/auth/tmdb-http-interceptor.feature';
import {
provideTmdbImageLoader,
tmdbContentTypeInterceptor,
tmdbReadAccessInterceptor,
} from 'angular-movies';
import { requestTimingInterceptor } from './http-timing.interceptor';

const serverConfig: ApplicationConfig = {
Expand All @@ -24,7 +26,7 @@ const serverConfig: ApplicationConfig = {
}),
])
),
provideISR(),
provideTmdbImageLoader(),
provideFastSVG({
url: (name: string) =>
`dist/projects/movies/browser/assets/svg-icons/${name}.svg`,
Expand Down

0 comments on commit 1aa23c6

Please sign in to comment.