@magicbell/core
Version:
Official MagicBell API wrapper
21 lines • 535 B
JavaScript
import { fetchAPI } from '../../lib/ajax.js';
/**
* Class to interact with the config API endpoint.
*
* @example
* const repo = new ConfigRepository();
* const config = await repo.get();
*/
export default class ConfigRepository {
remotePathOrUrl;
constructor(remotePathOrUrl = '/config') {
this.remotePathOrUrl = remotePathOrUrl;
}
/**
* Get the configuration from the API server.
*/
get() {
return fetchAPI(this.remotePathOrUrl);
}
}
//# sourceMappingURL=ConfigRepository.js.map