Commit 963eb2ff authored by Bryce Johnson's avatar Bryce Johnson
Browse files

Clean up method order in subbable.

parent bf37c477
......@@ -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))
......
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