diff options
author | Bryce Johnson <bryce@gitlab.com> | 2016-10-25 14:02:09 +0200 |
---|---|---|
committer | Bryce Johnson <bryce@gitlab.com> | 2016-10-25 14:02:09 +0200 |
commit | 963eb2ff3b5643bc04428f053aaab079a4999774 (patch) | |
tree | 433040275b7b438b5370792b76a46371c2adfe10 | |
parent | bf37c477a2f08632f5b49ca4d2e18df718efa794 (diff) | |
download | gitlab-ce-gfm-pubsub-fork.tar.gz |
Clean up method order in subbable.gfm-pubsub-fork
-rw-r--r-- | app/assets/javascripts/subbable_resource.js.es6 | 14 |
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)) |