src/helpers/Storage.js
import Client from '../Client';
/**
* Helper class representing a Section.
*
* @todo change the documentation so it is not array based
*/
class Storage {
/**
* Gets devices from storage
*
* @type {Promise<ContentType[]>}
* @return {Promise<ContentType[]>} - Devices from storage
*/
get contentTypes() {
return Client.instance.storageUtility.get('dynamic_content__content_types');
}
/**
* Gets devices from storage
*
* @type {Promise<Device[]>}
* @return {Promise<Device[]>} - Devices from storage
*/
get devices() {
return Client.instance.storageUtility.get('devices');
}
/**
* Gets alerts from storage
*
* @type {Promise<AppMenu[]>}
* @return {Promise<AppMenu[]>} - Alert Messages from storage
*/
get menus() {
return Client.instance.storageUtility.get('navigation__app_menus');
}
/**
* Gets notifications from storage
*
* @type {Promise<Notification[]>}
* @return {Promise<Notification[]>} - Notification from storage
*/
get notifications() {
return Client.instance.storageUtility.get('notification__deliveries');
}
}
export default Storage;