fix: address refactor comments

This commit is contained in:
Alex de Wergifosse
2020-12-16 10:20:10 +08:00
committed by Jun Yang
parent b8e4b3337b
commit 6a0ad102a8
8 changed files with 19 additions and 15 deletions
+4 -1
View File
@@ -4,7 +4,10 @@ import { Template } from '../template/template'
import { Emitter } from './emitter'
export class Render {
public * renderTemplates (templates: Template[], ctx: Context, emitter: Emitter): IterableIterator<any> {
public * renderTemplates (templates: Template[], ctx: Context, emitter?: Emitter): IterableIterator<any> {
if (!emitter) {
emitter = new Emitter(ctx.opts.keepOutputType)
}
for (const tpl of templates) {
try {
const html = yield tpl.render(ctx, emitter)