Skip to content

Preserve collection type when filtering? #23

@karlbohlmark

Description

@karlbohlmark

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)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions