import { Doc } from '../models/misc'; export async function getDocs(): Promise { try { //Fetch default source docs const response = await fetch( 'https://d3dg1063dc54p9.cloudfront.net/combined.json', ); const data = await response.json(); //Create array of Doc objects const docs: Array = []; data.forEach((doc: Doc) => { docs.push(doc); }); return docs; } catch (error) { return null; } }