jaredLunde / jaredLunde/react-hook

Add remove method to cache (result of createCache method)

Open
#202 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
96
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
In some cases I would like to mark cache entry as "to reload in next use" so pretty much remove entry.

**Describe the solution you'd like**
Internal cache's lru already has delete method, please just expose it.

**Describe alternatives you've considered**
I've considered creating separate cache instance and keep it in component's state but, as this cache is used by multiple components it would be quite complex solution.
Currently I write artificial value into a cache, and detect it when call useCache.

**Additional context**
None

Contributor guide

Open the contributing guide

Research direction

Locate the createCache implementation and inspect how its internal LRU cache is exposed to callers. Confirm the requested remove operation maps to the LRU delete behavior, then verify that entries can be removed and reloaded on the next use without changing other cache behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.