ericf / express-handlebars

A Handlebars view engine for Express which doesn't suck.
BSD 3-Clause "New" or "Revised" License
2.31k stars 384 forks source link

Support `Handlebars.registerHelper()` during `render()`? #11

Closed ericf closed 11 years ago

ericf commented 11 years ago

Currently an ExpressHandlebars instance only accesses the Handlebars.helpers during instance creation. This means that any calls to Handlebars.registerHelper() that occur after the instance is created will not be used.

Support for using all helpers registered the Handlebars can be implemented by always merging: global, instance, and render level helpers before each call to render.

This seems like reasonable behavior and worth the performance tradeoff (merging should be fast), to gain the expected behavior that Handlebars.registerHelper() should work anytime it's called.