Last active
November 18, 2016 16:22
-
-
Save benoror/d9a3fb6f4892897af390bcb9d8cbeddf to your computer and use it in GitHub Desktop.
app/helpers/is-empty-object.js
This file contains hidden or 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
/* | |
* Helper to detect an empty Object ( {} ) | |
* More info: https://github.com/emberjs/rfcs/issues/82 | |
*/ | |
import Ember from 'ember'; | |
const { Helper, isBlank } = Ember; | |
export function isEmptyObject(params) { | |
let [object] = params; | |
return isBlank(object) || Object.keys(object.data).length === 0; | |
} | |
export default Helper.helper(isEmptyObject); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment