GithubHelp home page GithubHelp logo

alduino / api-utils Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 162 KB

API client utilities based on swr for machine-generated clients

License: MIT License

JavaScript 2.71% TypeScript 97.29%
api react swr typescript utilities

api-utils's People

Contributors

alduino avatar github-actions[bot] avatar

Watchers

 avatar  avatar

api-utils's Issues

Don't allow null request for fetch functions

Allowing a null request means it has to be possible to have a null return, which means we have to handle this case. Seeing as handling this case increases code complexity and you rarely, if ever, would need to use a null query (unlike swr where you might, here requests are sent when you specifically tell them to, so you can check yourself if you want to just not send it), it would make more sense to not have this as an option.

API provider is global to all libraries using api-utils

The api provider is re-exported from a library, so it should only affect that library.

Currently, the provider is just a global React context that has one instance created in api-utils. Instead, each library should create one for itself, maybe by calling a function that returns the ApiProvider component and the useSwr hooks (or it could be a parameter passed to them, or a value in the Endpoints)

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.