Last active
May 13, 2020 10:44
-
-
Save Panman82/04d96915d8854f20ede4a4788fcb11e3 to your computer and use it in GitHub Desktop.
Ember.js Coalesce Template Helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { helper } from '@ember/component/helper'; | |
export function coalesce(...args) { | |
return args.find(arg => arg !== null && arg !== undefined); | |
} | |
export default helper(params => coalesce(...params)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment