Skip to content

Commit

Permalink
feat(lib): lazy url config
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherPHolder committed Oct 13, 2024
1 parent 545a81d commit c4e3ff5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/ngx-fast-icon-demo/src/app/app.config.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import { appConfig } from './app.config';

@Injectable()
export class SvgLoadStrategySsr implements SvgLoadStrategy {
config = (url: string) => of(join(cwd(), 'packages', 'ngx-fast-icon-demo', 'src', 'assets', 'svg-icons', url));
config(url: string) {
return of(join(cwd(), 'packages', 'ngx-fast-icon-demo', 'src', 'assets', 'svg-icons', url));
}
load(iconPath$: Observable<string>) {
return iconPath$.pipe(switchMap((iconPath) => from(readFile(iconPath, { encoding: 'utf8' }))))
}
Expand Down
4 changes: 3 additions & 1 deletion packages/ngx-fast-lib/src/lib/token/svg-load.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ export class SvgLoadStrategyImpl implements SvgLoadStrategy {
}));
}

config = (url: string) => of(url);
config(url: string) {
return of(url);
}
}

0 comments on commit c4e3ff5

Please sign in to comment.