-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Search custom feeds #1031
Search custom feeds #1031
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. I think we could squeeze slightly better perf out of it by moving the feeds
property to _feeds
and replacing it with a get feeds()
accessor that runs the filtering logic against _feeds
that's currently being applied in search()
. Then the search function would just set a a searchQuery property that drives the get feeds()
accessor, and you can drop some of the refreshes in the view when the search query state changes.
Oh I accidentally marked that as approved instead of just a comment. Sec while I test. |
Good idea. Let me do that…
…On Tue, Jul 18, 2023 at 12:51 PM, Paul Frazee < ***@***.*** > wrote:
***@***.**** approved this pull request.
Looking good. I think we could squeeze slightly better perf out of it by
moving the feeds property to _feeds and replacing it with a get feeds() accessor
that runs the filtering logic against _feeds that's currently being applied
in search(). Then the search function would just set a a searchQuery
property that drives the get feeds() accessor, and you can drop some of the
refreshes in the view when the search query state changes.
—
Reply to this email directly, view it on GitHub (
#1031 (review)
) , or unsubscribe (
https://github.com/notifications/unsubscribe-auth/AB6T25OGHR5RP5LWKJ7IOBLXQ3SKPANCNFSM6AAAAAA2OYL224
).
You are receiving this because you authored the thread. Message ID: <bluesky-social/social-app/pull/1031/review/1535807087
@ github. com>
|
Waiting on confirmation from @estrattonbailey about implementing this on the backend... Steady lads 🖖🏽 |
@pfrazee Need a re-review since now search is taking place on the backend |
@ansh What's the status of this being deployed on backend? I just tested and it's not in prod yet |
Scratch that -- the validation was failing clientside because I hadnt run yarn |
const [query, setQuery] = React.useState<string>('') | ||
const debouncedSearchFeeds = React.useMemo( | ||
() => debounce(() => feeds.search(query), 200), // debouce for 200 ms | ||
[feeds, query], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't working -- passing query
into the memo deps was recreating the function every time, losing the debounce state and having no effect.
I fixed that, tuned the timeout to 1s, and then updated onSubmitQuery
to use debounce but run a flush()
so that it triggers immediately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Allows you to search custom feeds by their name or description