pikax/vue-composable

Simplified sugar for useDevtoolsInspector

antfu opened this issue · 3 comments

antfu commented

useDevtoolsInspector is definitely a great idea and it's very helpful for debugging and track reactivity changes.

However, the current API seems a bit too complex for users to just plug in and test out like console.log. Giving the flexibility to customization is great, just wondering if it's possible to have a sugar overload or another function works like this:

const counter = ref(0)

useDevtoolsInspector('counter', counter)

Thanks!

pikax commented

Yeah the current API for inspector is basically the raw API for devtools

I'll add a few more composables for that, thinking in having something like useDevtoolsInspectorComponent('counter', counter) which would append to that component automatically when inspecting the component

pikax commented

Working on a PoC:

const text = ref("my event");

useDevtoolsComponentState({
  text
})

image

antfu commented

🤩 this is great!