Fork me on GitHub
#cider
<
2023-03-26
>
David Ackerman00:03:04

my actual use case right now: I want to interactively run some query selectors against my browser from a puppeteer connection, where nearly every command returns a promise. so i want to run a selector and see the output, tweak it and look again, etc. so the faster i can do that loop the better

borkdude07:03:25

@david.w.ackerman You can use nbb.core/await for this :)

borkdude07:03:12

Also this project contains a REPL+promise friendly macro: https://github.com/borkdude/deflet#nbb

David Ackerman00:03:05

thank you, i didn't expect it to be in the base library of nbb! I guess since unwrapping the promise changes when the data is returned and is not just a pure transformation, it would have to be handled by the repl server instead of the client (i.e CIDER)?

borkdude06:03:57

No, because nbb has support for this, it also works in normal code

borkdude06:03:27

Also, deflect isn’t part of nbb but you can add it as a dependency in nbb.edn