0xReed.lens

@0xreed
5 Followers
29 Following
9 Posts

@schizanon

POS - Proof Of Strike

@schizanon yeah with allSettled you can still use the accounts that didn't error, and display some error or toast for the ones that did. if you use .all then its an all or nothing situation where if one account fails you get zero results. both are acceptable, as a user i would like if the accounts that still worked, still loaded though :)
@schizanon oh i'm late to the party, essentially the same answer as here https://mastodon.social/@emilis@fosstodon.org/110751139741621242 😆

@schizanon you might want to use `Promise.allSettled` instead of `Promise.all` so that a single failed call doesn't abort all of them, but that aside, what about something like this if you don't like the direct indexing?

Object.fromEntries(await Promise.all(Object.entries(args).map(async ([key, arg]) => [key, await asyncFunction(arg)])))

of course could be simplified into smaller helper functions instead of a one liner though 😅

@cornflour sounds like an eslint rule to me 😅
@schizanon sort by date would be nicer, but difficult since maybe one account has 200 posts to display in the past hour, but the other account only has one per day. Tricky to reconcile with the pagination. Good luck! I like the idea
lol thanks for the autocomplete github copilot i know
@cornflour @schizanon good thread. It essentially boils down to the fact you can't know what the response truly is without checking. Maybe it's a server error, maybe the network is down etc. unknown is annoying to work with, but any other type would be ignoring these possible edge cases. If you don't care, you can just cast it

The crinimal SBF who was not supposed to have any money somehow magically posted bail and spends no day in jail waiting trial. He stole $10B.

At the same time @alex_pertsev is on his 163rd day of prison time without a proper trial for writing #opensource code.