|
@@ -11,7 +11,7 @@ const Plugin = {
|
|
|
install(Vue, options) {
|
|
|
assert(_.isObject(options));
|
|
|
if (options.debug && !_.isFunction(options.debug)) {
|
|
|
- options.debug = str => {
|
|
|
+ options.debug = (str) => {
|
|
|
console.log(str);
|
|
|
};
|
|
|
}
|
|
@@ -22,7 +22,7 @@ const Plugin = {
|
|
|
|
|
|
|
|
|
Vue.mixin({
|
|
|
- beforeDestroy: function() {
|
|
|
+ beforeDestroy: function () {
|
|
|
if (this.$stompClient) {
|
|
|
this.$stompClient.deactivate();
|
|
|
delete this.$stompClient;
|
|
@@ -31,21 +31,21 @@ const Plugin = {
|
|
|
});
|
|
|
|
|
|
|
|
|
- Vue.prototype.$stomp = function(subscribes = {}) {
|
|
|
+ Vue.prototype.$stomp = function (subscribes = {}) {
|
|
|
|
|
|
const client = new Client(options);
|
|
|
- client.onConnect = frame => {
|
|
|
+ client.onConnect = (frame) => {
|
|
|
|
|
|
|
|
|
console.log('[stomp] connected');
|
|
|
Object.keys(subscribes)
|
|
|
- .filter(p => _.isFunction(subscribes[p]))
|
|
|
- .forEach(key => {
|
|
|
+ .filter((p) => _.isFunction(subscribes[p]))
|
|
|
+ .forEach((key) => {
|
|
|
client.subscribe(key, subscribes[key]);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- client.onStompError = frame => {
|
|
|
+ client.onStompError = (frame) => {
|
|
|
|
|
|
|
|
|
|