import { Story } from './types' ; const API_URL = 'https://hacker-news.firebaseio.com/v0' ; export const fetchAllNewStories = async ( ) => { const response = await fetch ( `${ API_URL }/newstories.json` ) ; const parsed = await response . json ( ) ; return parsed ; } ; export const fetchStory = async ( item ) => { const response = await fetch ( `${ API_URL }/item/${ item }.json` ) ; const parsed = await response . json ( ) ; return parsed ; } ;