3 ms·
Project looks definitely interesting. Too bad the code looks like callback-hell from 10 years ago: https://github.com/tdjsnelling/dat-keyserver/commit/12fa3e838
by Leace 7y ago
Project looks definitely interesting. Too bad the code looks like callback-hell from 10 years ago: https://github.com/tdjsnelling/dat-keyserver/commit/12fa3e8389a6f90d312e1e664006df4d8391ecd5 https://github.com/tdjsnelling/dat-keyserver/commit/12fa3e83...
Still, an interesting alternative for people who consider https://keys.openpgp.org https://keys.openpgp.org too radical.
- snek 7y agoOP, please Google "promise chaining", it will make your life so much better.
- sltkr 7y agoAt that point, why not go straight to async functions? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- agentultra 7y agoAt that point, why not go straight to monads? https://github.com/fluture-js/Fluture/tree/11.x https://github.com/fluture-js/Fluture/tree/11.x
- vimslayer 7y agoBecause one is a language feature and the other is yet another JS library made by some person.
- ofrzeta 7y agoI don't really get why people need to use async methods (regardless if they are promises or something else) when in fact they are implementing a blocking workflow where one method call needs the results of a preceding method call. It would be much easier to just use synchronized/blocking functions because then you get the desired behaviour for free and need not jump through hoops like promises chaining. I get that there are APIs that are only available in an async fashion these days and I was forced to bolt on an blocking workflow on an async API myself and didn't particularly enjoy it.
- doliveira 7y agoNot sure I understand your complaint. Don't promises ultimately wait upon external events, like a connection receiving data or a timeout being triggered? Given that Javascript is single threaded it is the only way of not blocking the event loop.