Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export query() function #359

Open
cowboyd opened this issue Apr 26, 2019 · 0 comments
Open

Export query() function #359

cowboyd opened this issue Apr 26, 2019 · 0 comments

Comments

@cowboyd
Copy link
Member

cowboyd commented Apr 26, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant