# javascript

Don't forget 'this' when updating Alpine state

I recently had to implement an auto-save feature for a text editor (this one, in fact!), and ran into a slightly-surprising limitation in Alpine's state management. The problem arises when you need to get or set the state of a model from outside the model object, such as from inside a setInterval call. Here is some code to demonstrate what *...