Skip to content

Export query() function #359

@cowboyd

Description

@cowboyd

The underlying api for map, filter, reduce and friends is actually useful in its own right if you want to start your own queries from a base iterable, so that instead of:

for (let desc of map(state.todos, todo => todo.description)) {
}

You can say:

for (let desc of query(state.todos).map(todo => todo.description) {
}

It's more than just stylistic though since queries are monadic, you can make them arbitrarily complex.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions