Skip to content

Instantly share code, notes, and snippets.

View lucasDSBR's full-sized avatar
:octocat:
...

Lucas Maciel lucasDSBR

:octocat:
...
View GitHub Profile
import { useEffect, useRef, useState } from 'react';
const isObjectEqual = (objA, objB) => {
return JSON.stringify(objA) === JSON.stringify(objB);
};
const useFetch = (url, options) => {
const [result, setResult] = useState(null);
const [loading, setLoading] = useState(false);
const [shouldLoad, setShouldLoad] = useState(false);
@lucasDSBR
lucasDSBR / banco-de-dados.json
Created September 27, 2021 02:04
JSON para api "fake". Escrito para utilizar na realização de testes em aplicações.
{
"ofertas": [
{
"id": 1,
"categoria": "restaurante",
"titulo": "Super Burger",
"descricao_oferta": "Rodízio de Mini-hambúrger com opção de entrada.",
"anunciante": "Original Burger",
"valor": 15.90,
"destaque": true,