Skip to content

Commit

Permalink
refactor: refactor constructor initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandotv committed Jun 1, 2021
1 parent be44ae5 commit 92effb1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/radioBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import {
export class RadioBrowserApi {
protected baseUrl = 'https://fr1.api.radio-browser.info/json'

hideBroken: boolean

protected fetchConfig: RequestInit = {
method: 'GET',
redirect: 'follow'
Expand All @@ -33,13 +31,12 @@ export class RadioBrowserApi {
constructor(
protected fetchImpl: typeof fetch,
protected appName: string,
hideBroken = true
protected hideBroken = true
) {
if (!appName) {
throw new Error('appName is requred')
}
this.fetchConfig.headers = { 'user-agent': this.appName }
this.hideBroken = hideBroken
}

/**
Expand Down

0 comments on commit 92effb1

Please sign in to comment.