mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add test for crossfilter.groupAll()
This commit is contained in:
@@ -24,6 +24,11 @@ var payments = crossfilter<Payment>([
|
||||
{date: "2011-11-14T17:29:52Z", quantity: 1, total: 200, tip: 100, type: "visa"}
|
||||
]);
|
||||
|
||||
var total_payments : number = payments.groupAll<number>().reduce(
|
||||
function(p,v) { return p+=v; },
|
||||
function(p,v) { return p-=v; },
|
||||
function() { return 0; } ).value();
|
||||
|
||||
var paymentsByTotal = payments.dimension((d) => d.total);
|
||||
|
||||
// Filters
|
||||
|
||||
Reference in New Issue
Block a user