clar1k pfp
clar1k
@clar1k
i like this code much more than fetch i also hate error handling in js with try catch go error handling is decent.
1 reply
0 recast
3 reactions

Vladyslav Dalechyn pfp
Vladyslav Dalechyn
@dalechyn.eth
you can make a similar try catch exp by using a wrapper function wrap<T, E>(cb: () => T|Promise<T>): [E, null] | [null, T] { try { return [null,await cb()] as const } catch(e) { return [e as E, null] as const }} or try neverthrow
1 reply
0 recast
1 reaction