Creates a new instance of the passed in ctor with the Enumerable as input. Useful for custom iterables.
The source Iterable.
The constructor function to create the result.
A new instance of the passed in ctor with the enumerable passed as input.
class MyCustomEnumerable<T> extends Enumerable<T> { public foo(): void { console.log('hello'); }}const items = [1, 2, 3];const asCustom = from(items).to(MyCustomEnumerable); // asCustom is now a MyCustomEnumerable instance. Copy
class MyCustomEnumerable<T> extends Enumerable<T> { public foo(): void { console.log('hello'); }}const items = [1, 2, 3];const asCustom = from(items).to(MyCustomEnumerable); // asCustom is now a MyCustomEnumerable instance.
TSource The type of the source iterable.
TResult The type of the returned object.
Creates a new instance of the passed in ctor with the Enumerable as input. Useful for custom iterables.