Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 18, 2021 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/49d637c8363a003e0c058c1c83e53757 to your computer and use it in GitHub Desktop.
Save parzibyte/49d637c8363a003e0c058c1c83e53757 to your computer and use it in GitHub Desktop.
const CLAVE_LOCALSTORAGE = "lista_tareas";
const obtenerTareasDeAlmacenamiento = () => {
const posibleLista = JSON.parse(localStorage.getItem(CLAVE_LOCALSTORAGE));
if (posibleLista) {
return posibleLista;
} else {
return [];
}
};
const guardarTareasEnAlmacenamiento = () => {
localStorage.setItem(CLAVE_LOCALSTORAGE, JSON.stringify(tareas));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment