Created
January 2, 2017 22:27
-
-
Save bdmac/deb73f1e2138b1360d73802f1af45ab0 to your computer and use it in GitHub Desktop.
Online users component
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
import Ember from 'ember'; | |
const { Component, inject, computed } = Ember; | |
export default Component.extend({ | |
session: inject.service(), | |
// Get me all online users except myself | |
onlineUsers: computed.filter('[email protected]', function(user) { | |
return user.get('online') && user.get('id') != this.get('session.currentUser.id'); | |
}), | |
anyOnline: computed.notEmpty('onlineUsers') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment