Commit fafc15f0 authored by Bryce Johnson's avatar Bryce Johnson

Break up mount hook actions.

parent ff8adc9d
...@@ -46,19 +46,21 @@ function getRandomInt(min, max) { ...@@ -46,19 +46,21 @@ function getRandomInt(min, max) {
this.issuable = data; this.issuable = data;
}, },
}, subscribeToUpdates() {
created() {
this.fetchIssuable();
},
mounted() {
gl.IssuableResource.subscribe(data => this.updateState(data)); gl.IssuableResource.subscribe(data => this.updateState(data));
this.initPolling(); },
listenForSlashCommands() {
$(document).on('ajax:success', '.gfm-form', (e) => { $(document).on('ajax:success', '.gfm-form', (e) => {
// TODO: check if slash command was updated. // TODO: check if slash command was updated.
this.fetchIssuable(); this.fetchIssuable();
}); });
} }
},
mounted() {
this.initPolling();
this.subscribeToUpdates();
this.listenForSlashCommands();
}
}); });
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment