Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

api.ts

13 lines332 Bytes

1import { HttpClient } from '@angular/common/http'
2import { Injectable, inject } from '@angular/core'
3import type { Repo } from './types'
4​
5@Injectable({
6 providedIn: 'root',
7})
8export class ReposAPI {
9 readonly #http = inject(HttpClient)
10​
11 getRepo = () =>
12 this.#http.get<Repo>('https://api.github.com/repos/TanStack/query')