enumerable icon indicating copy to clipboard operation
enumerable copied to clipboard

Preserve collection type when filtering?

Open karlbohlmark opened this issue 12 years ago • 0 comments

Would it be a bad idea to ensure that in the following example, given that collection is an instance of an Enumerable subtype, filteredCollection is of the same type instead of being a vanilla Enumerable?

var filteredCollection = collection.select(predicate)

Or another way to put it: Would it be reasonable to change https://github.com/component/enumerable/blob/master/index.js#L163 into new this.constructor(arr)?

karlbohlmark avatar Aug 09 '13 13:08 karlbohlmark