1
2
3
4
5
6
7
8
9
10
11
12
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
import { HNcache } from "https://esm.town/v/stevekrouse/HNcache";
import { hnPostIdsBy } from "https://esm.town/v/akkartik/hnPostIdsBy?v=3";
export let hnPostsBy = async (user) => {
let postIds = await hnPostIdsBy(user);
return postIds.slice(0, 10).map(async (id) => {
HNcache[id] = await fetchJSON(
`https://hacker-news.firebaseio.com/v0/item/${id}.json`
);
});
};