Add group by helper.
parent
3bb540b6d7
commit
53cd77513f
|
@ -50,8 +50,16 @@ toggleText = (element, texts) ->
|
|||
element.data('nextTextPosition', nextTextPosition + 1)
|
||||
element.text(text)
|
||||
|
||||
groupBy = (coll, pred) ->
|
||||
result = {}
|
||||
for item in coll
|
||||
result[pred(item)] = item
|
||||
|
||||
return result
|
||||
|
||||
taiga = @.taiga
|
||||
taiga.bindOnce = bindOnce
|
||||
taiga.mixOf = mixOf
|
||||
taiga.trim = trim
|
||||
taiga.toggleText = toggleText
|
||||
taiga.groupBy = groupBy
|
||||
|
|
Loading…
Reference in New Issue