Skip to content

Commit b1410f8

Browse files
author
Alex Cory
committed
Merge branch 'master' of github.com:alex-cory/react-usefetch
2 parents 21e764d + b25c8cb commit b1410f8

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,24 @@
1616
<a href="https://lgtm.com/projects/g/alex-cory/use-http/context:javascript">
1717
<img alt="undefined" src="https://img.shields.io/lgtm/grade/javascript/g/alex-cory/use-http.svg?logo=lgtm&logoWidth=18"/>
1818
</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>
2219
<a href="https://bundlephobia.com/result?p=use-http">
2320
<img alt="undefined" src="https://img.shields.io/bundlephobia/minzip/use-http.svg">
2421
</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>
2537
</p>
2638

2739
<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
3345
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.
3446
</p>
3547

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+
3656
### 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>
3859

3960
Installation
4061
------------
@@ -297,8 +318,11 @@ Todos
297318
- [ ] if no url is specified, and we're in the browser, use `window.location.href`
298319
- [ ] github page/website
299320
- [ ] 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)
300323
- [ ] add GraphQL `useQuery`, `useMutation`
301324
- [ ] make GraphQL work with React Suspense
325+
- [ ] make GraphQL examples
302326
#### Mutations with Suspense <sup>(Not Implemented Yet)</sup>
303327
```jsx
304328
const App = () => {

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@
6969
"react fetch hook",
7070
"graphql",
7171
"mutation",
72-
"query"
72+
"query",
73+
"useAxios",
74+
"use-axios",
75+
"use-superagent",
76+
"superagent",
77+
"apollo",
78+
"useGraphQL",
79+
"use-graphql"
7380
]
7481
}

src/useFetch.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export function useFetch(arg1: string | Options & RequestInit, arg2: Options) {
9999
controller.current && controller.current.abort()
100100
}, [])
101101

102-
103102
const request = useMemo(() => ({ get, post, patch, put, del, delete: del, abort, query, mutate }), [])
104103

105104
useEffect(() => {

0 commit comments

Comments
 (0)