Fetching and curating posts per user without merge.

This commit is contained in:
2024-09-11 05:16:56 +02:00
parent 3c64ffcd45
commit bba0f8f1d7
8 changed files with 68 additions and 30 deletions

View File

@@ -34,7 +34,7 @@ const getPosts = async (username, reddit, args) => {
}
};
const getUserPostsWrap = (reddit, args) => usernames => Promise.props(usernames.reduce((userPosts, username) => {
const getUserPostsWrap = (reddit, args) => users => Promise.props(Object.entries(users).reduce((userPosts, [username, user]) => {
userPosts[username] = (async () => {
const [user, posts] = await Promise.all([
getUser(username, reddit),