Skip to content

Instantly share code, notes, and snippets.

@rohozhnikoff
Created September 3, 2014 13:40
Show Gist options
  • Save rohozhnikoff/838b0d824c86ef501047 to your computer and use it in GitHub Desktop.
Save rohozhnikoff/838b0d824c86ef501047 to your computer and use it in GitHub Desktop.
block helper to check if arguments is equal
`import Em from 'ember'`
equal = (args..., options) ->
arr = for arg in args
value = @get(arg)
if typeof value isnt 'undefined' then value else arg
method = if _.isEqual.apply(_, arr) then 'fn' else 'inverse'
return options[method](@)
EqualHelper = Em.Handlebars.registerHelper 'equal', equal
`export { equal }`
`export default EqualHelper`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment