Closed toiim closed 1 year ago
@toiim are you using the latest beta?
@israelidanny The dependancy in my package.json
is "honeycomb-grid": "4.0.0-beta.8"
Maybe you can use shallowRef
?
const Tile = defineHex({ dimensions: 30 })
const grid = new Grid(Tile, rectangle({ width: 5, height: 5 }))
const reactiveGrid = shallowRef(grid))
const coordinates = computed(() => reactiveGrid.value.toJSON().coordinates)
If that doesn't meet your needs I suggest you only make the properties you need reactive. I haven't tested this, but it should work:
const Tile = defineHex({ dimensions: 30 })
const grid = new Grid(Tile, rectangle({ width: 5, height: 5 }))
const coordinates = computed(() => grid.toJSON().coordinates)
Closing this because I assume the issue is fixed.
Hello Abbe,
Thanks for putting together such a lovely library. I've enjoyed using your library in vanilla JS but am having issues using it alongside the rest of my app is VueJS. Whenever I use Vue's reactivity on top of honeycomb, I get the type error
TypeError: Cannot read from private field
. I believe this behaviour is expected because of the private class implemented by honeycomb under the hood.What I'm not sure about is how I'm able to actually reference the grid created by new Grid in a way that is reactive and will reflect changes in the template. Is there a preferred way of exposing Honeycomb to other JS libraries? Is there something unique going on here or am I missing something obvious. Below is a simple example of what I'm talking about.
I know this is not an issue with your library specifically but any help would be appreciated.