-
I am trying to write a TableSorter component using some principles of state machines. All of my code seems to be working as I expect, but I have a :class directive that is not doing what I expect. To check my expression, I am also logging the value of the expression, which does give me what I expect. Any guidance on what I'm doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I can identify some of the issues, but still having some problems, your system is quite different from how I would do it so I'm trying to solve without just rewriting in my style. For starters, the reason it's not working is that you are referencing the object directly with After making this change though I'm getting that |
Beta Was this translation helpful? Give feedback.
I can identify some of the issues, but still having some problems, your system is quite different from how I would do it so I'm trying to solve without just rewriting in my style.
For starters, the reason it's not working is that you are referencing the object directly with
tableSort.blah
in the methods of the object. This won't work since that will be referring to the underlying object, while alpine will be listening for changes that pass through the proxy layer (which will bethis
in the functions). this is the reason why the functions themselves can get the correct result (they access and pass through the proxy to the object at the bottom) but the reactive listeners aren't triggered wh…