Closed madeInLagny closed 2 years ago
I would add an observer on connectedCallback in this case:
connectedCallback() {
super.connectedCallback()
myState.addObserver(() => {dothings}, ['collapsed'])
}
and remove the observer at disconnectedCallback
Will do so. Thanks
That's the way indeed. Also documented here.
Hello, Thank you for your great work with lit-state. I am trying to catch a state var change call back to trigger some actions when a specific state var gets updated.
won't work because myState.collapsed is not a component property. What is the recommended method to catch that state var update callback ?