0.3.0-alpha.2 • Published 4 years ago

rhdf v0.3.0-alpha.2

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

Rhdf — React Hooks for Data Fetching

Roadmap

  • ✅ useQuery hook that fires off request on mount
  • ✅ customize the request
  • ✅ use a cache, have query hook check cache
  • ✅ put cache in context
  • ✅ dep injection on the cache so that it can render on the server.
  • ✅ make cache aware of promises being run
  • ✅ Test using parallel requests to see how it handles concurrent rendering
    • This will need to make sure that the promises keep duplicate requests from firing, basically if one is in flight then set all of them to "loading"
  • ✅ testing
  • ✅ useMutation for "write" operations?
  • ✅ ability to create a new item in the cache with useMutation
  • ⬜️ Paginated queries
    • Some thoughts: would be cool if we could allow you to more directly affect the items in the cache, for example, having a list of items but also having each item individually cached 🤔
    • Full control of the caching might not be needed, at the very least we would want something like fetchMore functions on a usePaginatedQuery hook
    • Might be able to do the fine-grained stuff in the cache by simply using mutate to optimistically seed things when navigating. That way we're not preemptively seeding too many things into the cache.
  • ⬜️ better types for success data
    • For example, have data not be null when status is success?
  • ⬜️ suspense compatability?
    • should it be opt-in? Like a "suspense" flag either on a config ctx or in the useQuery hook itself.
  • ⬜️ Custom caching strategies
    • The idea would be to let you customize default caching strategies or per-request strategies. For example, you might be able to set a request to revalidate on a poll interval or use a "cache-first" mentality or a "stale-while-revalidate" approach.
    • This might be good time to also build in the ability to have your own custom cache.
  • ⬜️ Cache with dynamic keys "hashing". This would be similar to how react-query does it—if you pass a string it just uses the string as the cache key, if you pass an array of values it merges all the values into a single request key.
  • ⬜️ Retries on errors?
  • ⬜️ Cancel the request if the component unmounts before it completes?
  • automatic garbage collection a la react-query?

rhdf

0.3.0-alpha.2

4 years ago

0.3.0-alpha.1

4 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago