Files
threshold-ui/addons/api/addon/models/channel.js
T

25 lines
635 B
JavaScript
Raw Normal View History

2023-03-07 16:38:41 -05:00
import GeneratedChannelModel from '../generated/models/channel';
import { belongsTo } from '@ember-data/model';
export const TYPE_CHANNEL_SESSION = 'session';
export const TYPES_CHANNEL = Object.freeze([TYPE_CHANNEL_SESSION]);
export default class ChannelModel extends GeneratedChannelModel {
@belongsTo('connection') connection;
/**
* True if the channel type is `session`.
* @type {boolean}
*/
get isSession() {
return this.type === TYPE_CHANNEL_SESSION;
}
/**
* True if the channel is an unknown type.
* @type {boolean}
*/
get isUnknown() {
return !TYPES_CHANNEL.includes(this.type);
}
}