Closed JumpNRun closed 8 years ago
Investigating.
Also, FYI, the .nuget is out of date. :( I'll try to get it updated asap. I suggest pulling from NPM until then.
Ok right away this seems weird:
groups.forEach(x =>
{
var enumerable = new Linq.Enumerable(x.getEnumerator);
console.log(x.key + ': ' + enumerable.sum(x => x.Salary).toLocaleString())
});
Should be
groups.forEach(g =>
{
console.log(g.key + ': ' + g.sum(x => x.Salary).toLocaleString())
});
There is an issue you exposed where "IGrouping
Just pushed a fix for this to the master branch.
9859f1b9ca638e57242e82347c15a50575c126d6 2ae7aa4402775af9a331410fa994017e58b6eab0
Also fixed an issue with groupBy where the signature wouldn't infer types correctly.
You no longer need to put x=>x
after the selector.
@JumpNRun ... Here's the latest .nuget package... The AMD version will be removed eventually. https://www.nuget.org/packages/TypeScript.NET.Library
Hello, first of all i want to thank you for this great piece of work :) I'm using this in one of my current projects in a playground and found a bug? while playing around. I'm not sure if it really is a bug, it might be also just a misunderstanding of how this library works.
This works fine. But if i want to access the individual groups it doesn't work as i expected.
This code in the second line
enumerable.sum()
causes this error: "too much recursion". It looks like all methods throw this error. But this works:I'm coming from C# and the first option looks more intuitive. If this is is working as intended this might be a good thing to change? :)
Edit: I tested this in Firefox 41.0.2 In Chrome 46 i get this error: "Uncaught RangeError: Maximum call stack size exceeded"