After fixing some electron@7 bugs related to the deprecation of callback based version of functions, @alxhotel correctly bring the question of choosing to go full promise style or sync style when interacting with electron.
I created this issue so we can discus about it 😉
My opinion is to use sync style unless there is any drawback (performance, ...) 😅
What do you think?
Synchronous seems cleaner to avoid callback hell / unnecessary promise complexity.
For UI interactions, my hunch is there shouldn’t be any detectable performance implications since it’s all bottlenecked by user interactions.
If we're blocking to show a dialog to the user then using sync functions in the renderer seems fine!
(As long as we don't block in the webtorrent renderer – which would then cause all webtorrent work to stall.)
Closing this issue, as I think we have consensus here