UNPKG

dev-to-js

Version:

An universal client for the Dev.to API written in Typescript

15 lines (11 loc) 371 B
import { Base } from '../base' import { Comment } from './types' const resourceName = 'comments' export class Comments extends Base { getComment (commentId: string) { return this.request<Comment>(`${resourceName}/${commentId}`) } getComments (articleId: string) { return this.request<Comment[]>(`${resourceName}?a_id=${articleId}`) } }