https://github.com/dheerajmahra/react-use-medium
A React hook to fetch your Medium stories in json format 📝
https://github.com/dheerajmahra/react-use-medium
custom-hooks medium medium-stories react react-hooks
Last synced: 2 months ago
JSON representation
A React hook to fetch your Medium stories in json format 📝
- Host: GitHub
- URL: https://github.com/dheerajmahra/react-use-medium
- Owner: DheerajMahra
- License: mit
- Created: 2021-07-10T19:00:33.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-12T15:00:55.000Z (almost 4 years ago)
- Last Synced: 2025-03-28T00:01:36.131Z (3 months ago)
- Topics: custom-hooks, medium, medium-stories, react, react-hooks
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/react-use-medium
- Size: 6.84 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-use-medium
A React hook to fetch your Medium stories in json format 📝



## Live Demo
Checkout live demo of react-use-medium below
[CodeSandbox](https://codesandbox.io/s/react-use-medium-demo-fn91d?file=/src/App.jsx)
## Install
```
npm install react-use-medium
```## Import
```js
import { useMedium } from "react-use-medium";
```## Usage
```js
const { data, isFetched } = useMedium("");
```| _Returns_ | _Description_ |
| -------------------- | -------------------------------------------------------------------------------------------------------- |
| `data` : _obj_ | an object having user's information and stories; `{}` if username not found |
| `isFetched` : _bool_ | `true` if username is a valid Medium username and data has been fetched; `false` for all other scenarios |## Example
```js
import React from "react";
import { useMedium } from "react-use-medium";export default function Blogs() {
const { data, isFetched } = useMedium("dheerajmahra");
return isFetched ? : null;}
```## License
**MIT © [Dheeraj Mahra](https://github.com/dheerajmahra/react-use-medium/blob/master/LICENSE)**