MCPcopy
hub / github.com/ampproject/amphtml / waitForProp

Function waitForProp

test/unit/preact/test-base-element-runtime.js:72–80  ·  view source on GitHub ↗
(element, prop, targetValue)

Source from the content-addressed store, hash-verified

70 });
71
72 function waitForProp(element, prop, targetValue) {
73 return new Promise((resolve) => {
74 subscribe(element, [prop], (value) => {
75 if (value == targetValue) {
76 resolve();
77 }
78 });
79 });
80 }
81
82 it('preact ref passing vnode smoke test', () => {
83 function App() {

Callers 1

Calls 2

subscribeFunction · 0.90
resolveFunction · 0.50

Tested by

no test coverage detected