Skip to content

Registering multiple helpers at once? #369

Closed
@simevidas

Description

@simevidas

Does Handlebars provide a shorthand for registering multiple helpers at once, so that Handlebars.registerHelper doesn't have to be repeated multiple times in code?

I was thinking about being able to pass an object, like so:

Handlebars.registerHelper({
    helper1: function () { ... },
    helper2: function () { ... },
    helper3: function () { ... }
});

The way I currently do it is this:

$.each({
    helper1: function () { ... },
    helper2: function () { ... },
    helper3: function () { ... }
}, function ( name, handler ) {
    Handlebars.registerHelper( name, handler );
});

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions