Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function didEnter() {
requestAnimationFrame(() => {
expect(innerHTML(container.innerHTML)).toBe(
innerHTML("<div>Page No Async</div>")
);
done();
});
}
const routes = (
);
const renderProps = match(routes, "/");
doAllAsyncBefore(renderProps).then(() => {
// Then render
render(routes, container);
});
});
it("should resolve nested asyncBefore", done => {
const routes = (
);
const renderProps = match(routes, "/");
doAllAsyncBefore(renderProps).then(() => {
const html = InfernoServer.renderToString(
createElement(RouterContext, renderProps)
);
expect(html).toBe(
innerHTML(
"<div>Page Two <span>data page two</span><div>Section <span>data section</span></div></div>"
)
);
done();
});
});
history.listen(location => {
onEnter(match(routes, location), context)
})
ctx.isoRender = ({vDom, reducer, clientScript}) => {
const routes = vDom;
const renderProps = match(routes, ctx.url);
if (renderProps.redirect) {
return ctx.redirect(renderProps.redirect);
}
ctx.body = html(ctx, renderProps, reducer, clientScript);
};
await next();
export default async(ctx) => {
const renderProps = match(routes, ctx.url)
const bundleURL = config.server.DEV ? `//localhost:2002` : ''
if (renderProps.redirect) {
return ctx.redirect(renderProps.redirect)
}
if (config.server.SSR) {
try {
await onEnter(renderProps, ctx.context)
} catch(error) {
throw error
}
}
const components = config.server.SSR ? renderToStaticMarkup(