queckezz/koa-views

state won't pass if no locals are passed

Closed this issue · 3 comments

This line breaks my expected behavior: https://github.com/queckezz/koa-views/blob/master/index.js#L110

var state = locals && this.state ? Object.assign(locals, this.state) : {}

if locals is undefined or null - state becomes an empty object...
but what if i put information to state but nothing to locals? then i won't got in my views.

d6u commented

👍 If author thinks this should be fixed, I can create a PR.

PR already created

PR #47