* Returns the upgraded imperative API object, once Preact has actually mounted. * * This technically works with both Bento and Legacy components, returning the * BaseElement instance in the later case. * * @param {!Element} el * @return {!Promise<!Object>}
(el)
| 25 | * @return {!Promise<!Object>} |
| 26 | */ |
| 27 | function whenUpgraded(el) { |
| 28 | return el.ownerDocument.defaultView.customElements |
| 29 | .whenDefined(el.localName) |
| 30 | .then(() => el.getImpl()) |
| 31 | .then((impl) => impl.getApi()); |
| 32 | } |
| 33 | |
| 34 | describes.realWin('PreactBaseElement', {amp: true}, (env) => { |
| 35 | let win, doc, html; |
no test coverage detected