GithubHelp home page GithubHelp logo

z0al / oktane Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 0.0 1.44 MB

⚛️ A light-weight and customizable library for data fetching in React

License: MIT License

TypeScript 99.94% JavaScript 0.06%
cache data-driven fetch graphql hooks mutation query react react-query rest-api stream subscription

oktane's People

Contributors

z0al avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

oktane's Issues

[v1] Roadmap

This is a meta-issue to track progress towards the first stable release of Oktane. It's worth mentioning that the order of tasks listed here is not relevant.

Before v1.0.0

Tasks

  • Automatic fetching via useQuery
  • Manual fetching via useManualQuery
  • Prefetching (via client.prefetch)
  • Request cancellation & refetching
  • Helpers for infinite loading: hasMore and fetchMore.
  • Support Subscriptions
  • support refetching (acts like a the refresh button in the browser)
  • support passing options to useQuery & useManualQuery
  • Server Side Rendering (SSR)?
  • Retrying failed requests
  • React suspense support
  • Pass AbortController signal to the fetch function to enable true Promise(s) cancellation.
  • Throw an error if cache objects were mutated externally (e.g. in plugins, fetch handlers ..etc).
  • Official plugins:
    • Optimistic updates
  • Anything else? comment below.

Docs

  • Public API docs
    • createClient
    • useQuery
    • useManualQuery
    • useClient
  • Examples:
    • Basic
    • Pagination
    • Infinite loading
    • Subscription
    • Prefetching
    • Request cancellation
    • Using Observables
  • Anything else? comment below.

A bit later (maybe)

  • Provide Dev tooling support either by building from scratch or on the top of existing devtools.
  • Make it easy to run the client inside a Web Worker by wrapping helpers from comlink.

fix "not wrapped in act(...)" warning

The problem

When testing useFetch or useRequest the following warning appears randomly and I'm struggling to fix it.


Warning: An update to TestHook inside a test was not wrapped in act(...).
      
      When testing, code that causes React state updates should be wrapped into act(...):
      
      act(() => {
        /* fire events that update state */
      });
      /* assert on the output */
      
      This ensures that you're testing the behavior the user would see in the browser. Learn more at https://fb.me/react-wrap-tests-with-act
          in TestHook
          in Suspense
          in wrapper

For now, I will assume it's a bug.

Related reading

Fix the "not wrapped in act(...)" warning by Kent C. Dodds.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.