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