MCPcopy Create free account
hub / github.com/codecombat/codecombat / sortClanList

Method sortClanList

app/views/user/MainUserView.js:86–92  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

84 }
85
86 const sortClanList = function (a, b) {
87 if (a.get('members').length !== b.get('members').length) {
88 if (a.get('members').length < b.get('members').length) { return 1 } else { return -1 }
89 } else {
90 return b.id.localeCompare(a.id)
91 }
92 }
93
94 this.clans = new CocoCollection([], { url: `/db/user/${this.userID}/clans`, model: Clan, comparator: sortClanList })
95 this.listenTo(this.clans, 'sync', () => {

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected