Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucasfloriani/use-via-cep
Hook to abstract the logic to call viacep
https://github.com/lucasfloriani/use-via-cep
es6 hooks react typescript viacep
Last synced: about 2 months ago
JSON representation
Hook to abstract the logic to call viacep
- Host: GitHub
- URL: https://github.com/lucasfloriani/use-via-cep
- Owner: lucasfloriani
- Created: 2019-12-25T19:47:38.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-23T01:55:21.000Z (9 months ago)
- Last Synced: 2024-09-26T07:35:55.385Z (3 months ago)
- Topics: es6, hooks, react, typescript, viacep
- Language: JavaScript
- Homepage:
- Size: 650 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# use-via-cep
> Hook to abstract the logic to call viacep
[![NPM](https://img.shields.io/npm/v/use-via-cep.svg)](https://www.npmjs.com/package/use-via-cep) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
## Install
```bash
npm install --save use-via-cep
```## Usage
```tsx
import * as React from 'react'import { useViaCep } from 'use-via-cep'
const Example = () => {
const { cep, data, setCep } = useViaCep()
return (
setCep(target.value)} />
{JSON.stringify(data)}
)
}
```## License
MIT © [lucasfloriani](https://github.com/lucasfloriani)
---
This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).