blikblum / tinybind

Lightweight and powerful data binding + templating solution
http://blikblum.github.io/tinybind/
MIT License
80 stars 14 forks source link

Question: How to get full keypath during routine function? #35

Closed adelriosantiago closed 1 year ago

adelriosantiago commented 3 years ago

I came across the need to get the full keypath during the a routine call but I don't seem to know where to catch the full keypath for rv-each, I only get the partial path, example:

For the data:

items: [
    { todo: "get milk" },
    { todo: "buy meat" },
    { todo: "exercise" },
],

If I change the "get milk" and print the arguments of the binding in this line, I get:

image

As you can see it is only item.todo and not items[0].todo or items[1].todo or whatever the index is. How can I get the full path?

karneaud commented 1 year ago

I created a demo with a use case for how rv-each is handled and this works as intended, but to access the full path would be along the lines of items.0.todo, items.1.todo...etc. however there is no support at the moment for dynamic keypath within the loop if this is what you're asking for.