UNPKG

@virtualstate/examples

Version:
28 lines 826 B
import { assertPromiseVNode, ChildrenSource, h, thenish } from "@virtualstate/fringe"; async function* Whatever() { yield (h("p", null, h("z", null, h("a", null)), h("z", null, h("b", null)))); yield (h("p", null, h("z", null, h("a", null)), h("z", null, h("b", null)), h("z", null, h("c", null)))); } async function Example() { const node = (h(Whatever, null)); node.then = thenish; assertPromiseVNode(node); const [p] = await node; p.then = thenish; assertPromiseVNode(p); const result = await p; return result.map(node => node.children[ChildrenSource]); } export const _303_AsPromise = h(Example, null); export const _303_URL = import.meta.url; //# sourceMappingURL=as-promise.js.map