use-cep-hook
                                
                                
                                
                                    use-cep-hook copied to clipboard
                            
                            
                            
                        Brazilian CEP info on a elegant way! :scream_cat: :mag: :mailbox:
use-cep-hook :earth_americas:
This is a simple React Hooks that let you search for a brazillian postal-code.
Installation
Just run a yarn add use-cep-hook or npm i --save use-cep-hook
How to use
Simply import use-cep-hook on your component, then call this on that way:
import useCep from "use-cep-hook";
const Foo = () => {
  const [postalCode, setPostalCode] = useState("");
  const [loading, cep, error] = useCep(postalCode);
  return (
    <div className="field">
      <label>CEP:</label>
      <input onChange={e => setPostalCode(e.target.value)} value={postalCode} />
    </div>
  );
};
Every time that a valid CEP is passed to this hooks, this will cause a side effect that will search for the updated value.
You can check the full implementation here!
TODO:
- [x] Port to TS
 - [ ] Apply some cool CSS to 
example - [ ] Write TESTS!
 - [ ] Deploy example to GH pages!
 - [ ] Configure Github Actions