Fork me on GitHub
#portal
<
2022-05-27
>
seancorfield01:05:57

For Calva users, here's a customREPLCommandSnippet that cycles the most recent Portal value through each of the applicable viewers for it:

{
        "name": "Portal Viewer",
        "key": "0",
        "snippet": "(portal.api/eval-str \"(let [state portal.ui.state/state] (-> (portal.ui.commands/select-none state) (.then #(portal.ui.commands/select-child state)) (.then #(portal.ui.commands/select-child state)) (.then #(portal.ui.commands/select-next-viewer state)) (.then #(portal.ui.commands/select-none state))))\")"
      },
This can be invoked via Calva using ctrl+alt+space 0

🙌 4
pez08:05:47

@djblue, Calva now has that API for evaluating code through its REPL connection that you wished for eons ago. Don't know if you still need it, but it's there anyway. 😃 https://calva.io/api/