nuclear
nuclear copied to clipboard
Memoize request results wherever possible
In many cases we could benefit from memoizing stuff like search results from various services to minimize rate limiting and speed up repetitive searches. I plan to do that in the near future but if anyone wants to contribute, even a simple proof of concept in one action would be valuable.
Hi, My partner @nfeygin and I would like to work on this if possible
Okay, if you decide to work on this, let me know which parts are good candidates for memoizing.
sure
Hi ! can you please guide me from where should I start on working this ?
A good place to do this would be here: https://github.com/nukeop/nuclear/blob/master/packages/app/app/actions/search.ts
These thunks fire requests to various services, and the functions that do the requests could memoize results for a given set of search parameters.
which database have you used ?
You 've used this in line 27-> updateSearchHistory: createAction(Search.UPDATE_SEARCH_HISTORY, (searchHistory: string[]) => searchHistory
what's this function for?
We use Redux for storing search data, I don't want to memoize database access since that would be pretty pointless.
updateSearchHistory stores the last 5 search queries so we can show them as suggestions in the search bar, it's irrelevant for this task.