Files
ntfy/web/src/Subscription.js
Philipp Heckel 1fe598a966 Split stuff
2022-02-18 14:41:01 -05:00

20 lines
469 B
JavaScript

import {topicUrl, shortTopicUrl, topicUrlWs} from './utils';
export default class Subscription {
url = '';
baseUrl = '';
topic = '';
notifications = [];
constructor(baseUrl, topic) {
this.url = topicUrl(baseUrl, topic);
this.baseUrl = baseUrl;
this.topic = topic;
}
wsUrl() {
return topicUrlWs(this.baseUrl, this.topic);
}
shortUrl() {
return shortTopicUrl(this.baseUrl, this.topic);
}
}