zikofy 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { render } from 'preact';
|
|
2
|
+
|
|
1
3
|
export async function asyncDomify(Component, props) {
|
|
2
|
-
if (typeof Component !== 'function')
|
|
4
|
+
if (typeof Component !== 'function')
|
|
3
5
|
throw new Error('asyncDomify expects a function component');
|
|
4
|
-
}
|
|
5
6
|
|
|
6
7
|
const container = document.createElement('div');
|
|
7
|
-
|
|
8
|
-
const result = await Component(props); // await async JSX
|
|
8
|
+
const result = await Component(props);
|
|
9
9
|
render(result, container);
|
|
10
10
|
|
|
11
11
|
return container.children.length === 1
|