16
16
<a href="https://lgtm.com/projects/g/alex-cory/use-http/context:javascript">
17
17
<img alt="undefined" src="https://img.shields.io/lgtm/grade/javascript/g/alex-cory/use-http.svg?logo=lgtm&logoWidth=18"/>
18
18
</a>
19
- <a href="https://github.com/alex-cory/use-http/releases">
20
- <img alt="undefined" src="https://img.shields.io/github/release/alex-cory/use-http.svg?style=popout">
21
- </a>
22
19
<a href="https://bundlephobia.com/result?p=use-http">
23
20
<img alt="undefined" src="https://img.shields.io/bundlephobia/minzip/use-http.svg">
24
21
</a>
22
+ <a href="https://codeclimate.com/github/alex-cory/use-http/maintainability">
23
+ <img src="https://api.codeclimate.com/v1/badges/1e6c1ff8921b0f5ff6b3/maintainability" />
24
+ </a>
25
+ <a href="https://snyk.io/test/github/alex-cory/use-http?targetFile=package.json">
26
+ <img src="https://snyk.io/test/github/alex-cory/use-http/badge.svg?targetFile=package.json" alt="Known Vulnerabilities" data-canonical-src="https://snyk.io/test/github/alex-cory/use-http?targetFile=package.json" style="max-width:100%;">
27
+ </a>
28
+ <a href="https://www.npmjs.com/package/use-http">
29
+ <img src="https://img.shields.io/npm/v/use-http.svg" alt="Known Vulnerabilities" data-canonical-src="https://snyk.io/test/github/alex-cory/use-http?targetFile=package.json" style="max-width:100%;">
30
+ </a>
31
+ <a href="https://github.com/alex-cory/use-http/blob/master/license.md">
32
+ <img alt="undefined" src="https://img.shields.io/github/license/alex-cory/use-http.svg">
33
+ </a>
34
+ <a href="https://greenkeeper.io/">
35
+ <img alt="undefined" src="https://badges.greenkeeper.io/alex-cory/use-http.svg">
36
+ </a>
25
37
</p >
26
38
27
39
<img align =" right " src =" https://media.giphy.com/media/fAFg3xESCJyw/giphy.gif " />
@@ -33,8 +45,17 @@ Need to fetch some data? Try this one out. It's an isomorphic fetch hook. That m
33
45
A note on the documentation below. Many of these examples could have performance improvements using <code >useMemo</code > and <code >useCallback</code >, but for the sake of the beginner/ease of reading, they are left out.
34
46
</p >
35
47
48
+ Features
49
+ ---------
50
+
51
+ - SSR (server side rendering) support
52
+ - TypeScript support
53
+ - Zero dependencies (peer deps: react, react-dom)
54
+ - GraphQL support (queries + mutations)
55
+
36
56
### Examples
37
- - <a target =" _blank " rel =" noopener noreferrer " href =' https://codesandbox.io/embed/km04k9k9x5 ' >Code Sandbox Example</a >
57
+ - <a target =" _blank " rel =" noopener noreferrer " href =' https://codesandbox.io/s/usefetch-in-nextjs-nn9fm ' >Example - Next.js</a >
58
+ - <a target =" _blank " rel =" noopener noreferrer " href =' https://codesandbox.io/embed/km04k9k9x5 ' >Examples - create-react-app</a >
38
59
39
60
Installation
40
61
------------
@@ -297,8 +318,11 @@ Todos
297
318
- [ ] if no url is specified, and we're in the browser, use ` window .location .href `
298
319
- [ ] github page/website
299
320
- [ ] support for a global context config where you can set base url's (like Apollo's ` client` ) but better 😉
321
+ - [ ] fix code so Maintainability is A
322
+ - [ ] optimize badges [see awesome badge list](https://github.com/boennemann/badges)
300
323
- [ ] add GraphQL ` useQuery` , ` useMutation`
301
324
- [ ] make GraphQL work with React Suspense
325
+ - [ ] make GraphQL examples
302
326
#### Mutations with Suspense <sup>(Not Implemented Yet)</sup>
303
327
` ` ` jsx
304
328
const App = () => {
0 commit comments