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

Can findFirst() support the where parameter as function? #256

Open
cp3hnu opened this issue Dec 12, 2022 · 1 comment
Open

Can findFirst() support the where parameter as function? #256

cp3hnu opened this issue Dec 12, 2022 · 1 comment

Comments

@cp3hnu
Copy link

cp3hnu commented Dec 12, 2022

This API like that

model.findFirst({
  where: (item) => return true
});

It will be more flexible.

@cp3hnu cp3hnu changed the title cfindFirst() with where: function(item) Can findFirst() support the where parameter is function? Dec 12, 2022
@cp3hnu cp3hnu changed the title Can findFirst() support the where parameter is function? Can findFirst() support the where parameter is function? Dec 12, 2022
@cp3hnu cp3hnu changed the title Can findFirst() support the where parameter is function? Can findFirst() support the where parameter is function? Dec 12, 2022
@cp3hnu cp3hnu changed the title Can findFirst() support the where parameter is function? Whether findFirst() supports the where parameter as function? Dec 12, 2022
@cp3hnu cp3hnu changed the title Whether findFirst() supports the where parameter as function? Can findFirst() support the where parameter as function? Dec 12, 2022
@kettanaito
Copy link
Member

Hey, @cp3hnu. Thanks for proposing this!

If I remember the context correctly, the intention was to have all the queries serializable to string so that we could synchronize occurring operations between different tabs. That's still relevant for the current version of the library but may not be as relevant for the future releases.

The proposal itself makes sense. Let's keep it in mind, I shall revisit this when I'm working on this library again.

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

No branches or pull requests

2 participants