Draftlog with Vue Reactivity
Draftlog is a great tool for creating rich terminal logging experiences.
However, using it feels kind of imperative when coming from a data-driven frontend world (insofar as you have to decide on your own when to re-apply data and call the draft
function again).
This little code snippet marries Draftlog with the @vue/reactivity
(one of the earlier implementation of the signals pattern in the web development world).
You basically keep using console.draft()
just as before, but you can pass it reactive data which will cause the draft to update automatically when that data changes.