lbry.tech/views/components/html.js
ポール ウェッブ 4a962f9a9b Metadata is setup
2018-07-25 15:42:29 -05:00

24 lines
443 B
JavaScript
Executable file

"use strict";
// P A C K A G E
const html = require("choo-async/html");
// E X P O R T
module.exports = exports = (head, body) => (state, emit) => {
const bodyPromise = Promise.resolve(body(state, emit));
const headPromise = bodyPromise.then(() => head(state, emit)); // resolve `head` once `body` is resolved
return html`
<!DOCTYPE html>
<html lang="en">
${headPromise}
${bodyPromise}
</html>
`;
};