ssbc / ssb-friends

Manages the SSB social graph
MIT License
23 stars 6 forks source link

replace continuables with async-await #64

Closed staltz closed 3 years ago

staltz commented 3 years ago

Some context from Cabal chats:

staltz assuming this is a JS channel too: I want to eliminate continuables and replace them with async-await

example: https://github.com/ssbc/ssb-friends/blob/ee6df464f3e1814a7b68f543317e0bb0a8e61d3d/test/friends.js#L38https://github.com/ssbc/ssb-friends/blob/ee6df464f3e1814a7b68f543317e0bb0a8e61d3d/test/friends.js#L38

continuables are a beautifully sound way of doing async in JS: https://github.com/Raynos/continuable

but in the name of reducing the amount of WTF the generic programmer will have when reading SSB code, we should use the least surprising async primitive there is out there, and that's async-await

also, continuables are a 8-year old idea that didn't catch on

glyph big +1 from me. more generic, more better (taking into account other trade-offs, of course)

staltz commented 3 years ago

Thanks for reviewing :)