src/services/AbstractService.js
import Client from '../Client';
/**
* An abstract class to setup various methods, attributes, and getters/setters.
*
* This is specifically used for caching, general serialization and types.
*/
class AbstractService {
/**
* Setup the cacheMode to be the client's setup
*/
constructor(type) {
/** @type {String} - The type of the default data */
this.type = type;
/** @type {String} - A string with various options for caching */
this._cacheMode = Client.instance.config.cacheMode;
}
/** @type {String} - A string with various options for caching */
get cacheMode() {
return this._cacheMode;
}
/** @type {String} - A string with various options for caching */
set cacheMode(_cacheMode) {
this._cacheMode = _cacheMode;
}
}
export default AbstractService;