cloudfour / core-hbs-helpers

Handlebars helpers that we usually need
MIT License
11 stars 2 forks source link

Should `defaultTo` accept multiple fallbacks? #20

Closed tylersticka closed 8 years ago

tylersticka commented 8 years ago

{{defaultTo something fallback}} is one of my favorite helpers. While writing up cloudfour/drizzle-builder#82, I wondered if it might make sense to accept one or more arguments, returning the first one that evaluates truthy?

Example:

{{defaultTo something somethingElse "okay, fine"}}
erikjung commented 8 years ago

I can't think of an argument against this behavior. 👍