context: Add on client-side

This commit is contained in:
Sébastien Chopin 2017-07-20 21:04:23 +02:00
parent d1d631a88e
commit 03aa65a888
2 changed files with 2 additions and 0 deletions

View File

@ -178,6 +178,7 @@ async function render (to, from, next) {
// Update context // Update context
const context = getContext({ const context = getContext({
to, to,
from,
<% if (store) { %>store,<% } %> <% if (store) { %>store,<% } %>
isClient: true, isClient: true,
next: _next.bind(this), next: _next.bind(this),

View File

@ -103,6 +103,7 @@ export function getContext (context, app) {
} }
if (context.req) ctx.req = context.req if (context.req) ctx.req = context.req
if (context.res) ctx.res = context.res if (context.res) ctx.res = context.res
if (context.from) ctx.from = context.from
return ctx return ctx
} }