Skip to content

Commit

Permalink
😐 Fix ready callback
Browse files Browse the repository at this point in the history
  • Loading branch information
VandeurenGlenn committed Mar 14, 2017
1 parent 44c8f2e commit 7cac849
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/backed.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default _class => {
base.handleObservers(this, _class.observers, _class.globalObservers);

// notify the user that we expect a ready callback (constructor is ignored when not CESV1)
base.shouldReady(_class, 1);
base.shouldReady(this, 1);
}
}
customElements.define(name, klass);
Expand All @@ -65,10 +65,10 @@ export default _class => {
base.handleObservers(this, _class.observers, _class.globalObservers);

// notify the user that we expect a ready callback (constructor is ignored when not CESV1)
base.shouldReady(_class, 0);
base.shouldReady(this, 1);
}
}
document.registerElement(name, klass)
document.registerElement(name, klass);
} else {
console.warn('classes::unsupported');
}
Expand Down
8 changes: 4 additions & 4 deletions src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ const handleObservers = (target, observers=[], globalObservers=[]) => {
forObservers(target, observers);
}

const shouldReady = (klass, version) => {
if (klass.ready) {
return klass.ready()
} else if(version === 1 && !klass.ignoreV0) {
const shouldReady = (target, version) => {
if (target.ready) {
return target.ready()
} else if(version === 1 && !target.ignoreV0) {
warnings.warn('CESV1');
} else if(version === 0) {
warnings.warn('CESV0');
Expand Down

0 comments on commit 7cac849

Please sign in to comment.