Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Johnson <bryce@gitlab.com>2016-10-25 15:02:09 +0300
committerBryce Johnson <bryce@gitlab.com>2016-10-25 15:02:09 +0300
commit963eb2ff3b5643bc04428f053aaab079a4999774 (patch)
tree433040275b7b438b5370792b76a46371c2adfe10
parentbf37c477a2f08632f5b49ca4d2e18df718efa794 (diff)
Clean up method order in subbable.gfm-pubsub-fork
-rw-r--r--app/assets/javascripts/subbable_resource.js.es614
1 files changed, 8 insertions, 6 deletions
diff --git a/app/assets/javascripts/subbable_resource.js.es6 b/app/assets/javascripts/subbable_resource.js.es6
index f86fe2769d1..520751a6ecb 100644
--- a/app/assets/javascripts/subbable_resource.js.es6
+++ b/app/assets/javascripts/subbable_resource.js.es6
@@ -51,6 +51,7 @@
};
this.init(pollCfg);
}
+
/* private methods */
init(pollCfg) {
@@ -92,12 +93,6 @@
return diff;
}
- /* public methods */
-
- subscribe(propToWatch, callback) {
- this.addSubscriber(propToWatch, callback);
- }
-
getResource() {
const totalSubscribers = Object.keys(this.subscribers).length;
if (!this.state.loading || !totalSubscribers) {
@@ -107,6 +102,13 @@
return this.get();
}
+
+ /* public methods */
+
+ subscribe(propToWatch, callback) {
+ this.addSubscriber(propToWatch, callback);
+ }
+
get() {
return this.resource.get()
.then((res) => this.updateState(res.data))