get-convex / convex-helpers

A collection of useful code to complement the official packages.
MIT License
66 stars 9 forks source link

new filter helper #71

Closed ldanilek closed 4 months ago

ldanilek commented 4 months ago

create a new function that can wrap any query: filter takes in a query and a javascript predicate and uses it for filtering.

i'm thinking this can accompany a stack article that explains that .filter() and filter() are basically the same.

also changed RowLevelSecurity to use this new filter internally.

added an example

ianmacartney commented 4 months ago

It'd also be nice to have filterExample.ts that exercise it a bit, possibly tied to a frontend component that lets you see some results / as manual testing until I set up more robust testing.

ldanilek commented 4 months ago

It'd also be nice to have filterExample.ts that exercise it a bit, possibly tied to a frontend component that lets you see some results / as manual testing until I set up more robust testing.

I was meaning to do this but got caught up today. Will try tomorrow