AbstractRadioService
On this page
- AbstractRadioService ⇐
Abstract- AbstractRadioService()
- getRadioList([options]) ⇒
Promise.<AbstractRadioList, Error> - getRadio(id) ⇒
Promise.<AbstractRadio> - _getRadioList() ⇒
*|Promise.<AbstractRadioList, Error> - _getRadio(id, radioList) ⇒
Radio|Promise.<Radio, Error> - _onRadioListChange(newRadioListDef, oldRadioListDef) ⇒
Promise - “radioListChange” (newRadioListDef, oldRadioListDef)
AbstractRadioService ⇐ Abstract
Kind: global abstract class
Extends: Abstract
Service:
- AbstractRadioService ⇐
Abstract- new AbstractRadioService()
- .getRadioList([options]) ⇒
Promise.<AbstractRadioList, Error> - .getRadio(id) ⇒
Promise.<AbstractRadio> - ._getRadioList() ⇒
*|Promise.<AbstractRadioList, Error> - ._getRadio(id, radioList) ⇒
Radio|Promise.<Radio, Error> - ._onRadioListChange(newRadioListDef, oldRadioListDef) ⇒
Promise - “radioListChange” (newRadioListDef, oldRadioListDef)
AbstractRadioService()
This class represents the service that handles the radios.
getRadioList([options]) ⇒ Promise.<AbstractRadioList, Error>
Get the radios of the current radio list , sorted by position.
Kind: instance method of AbstractRadioService
Returns: Promise.<AbstractRadioList, Error> - A promise resolved with an array of radios or rejected in case of problem
| Param | Type | Default | Description |
|---|---|---|---|
| [options] | Object | Additional options | |
| [options.duration] | number | | Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
getRadio(id) ⇒ Promise.<AbstractRadio>
Get a radio by its id. The radio must belongs to the list
Kind: instance method of AbstractRadioService
Returns: Promise.<AbstractRadio> - A promise resolved with the radio data (or undefined if not found).
| Param | Type | Description |
|---|---|---|
| id | string | the id of the radio |
_getRadioList() ⇒ * | Promise.<AbstractRadioList, Error>
Kind: instance abstract method of AbstractRadioService
_getRadio(id, radioList) ⇒ Radio | Promise.<Radio, Error>
Given the radioList, get the radio by it’s id
Kind: instance method of AbstractRadioService
Returns: Radio | Promise.<Radio, Error> - the found radio, null otherwise
Access: protected
| Param | Type | Description |
|---|---|---|
| id | string | the radio id |
| radioList | RadioList | The radio list |
_onRadioListChange(newRadioListDef, oldRadioListDef) ⇒ Promise
Kind: instance method of AbstractRadioService
Access: protected
| Param | Type |
|---|---|
| newRadioListDef | Array.<AbstractRadio> |
| oldRadioListDef | Array.<AbstractRadio> |
“radioListChange” (newRadioListDef, oldRadioListDef)
Fired when the current list has been changed
Kind: event emitted by AbstractRadioService
| Param | Type | Description |
|---|---|---|
| newRadioListDef | Object | The new list |
| oldRadioListDef | Object | The old list |