Files
threshold-ui/addons/api/addon/models/channel.js
T
Zhihe Li b9cf61932b feat: 🎸 Add session recording models (#100)
* feat: 🎸 Add session recording models

✅ Closes: ICU-8075
2023-03-07 16:38:41 -05:00

26 lines
635 B
JavaScript

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);
}
}