import { inject, Injectable, resource } from '@angular/core';
import { CountryService } from '../services';

@Injectable({ providedIn: 'root' })
export class CountryResource {
  #countryService = inject(CountryService);

  readonly resource = resource({
    loader: async ({ abortSignal }) =>
      this.#countryService.getCountries(abortSignal),
  });
}
