Brendan Barr

I am a web developer / entrepreneur who is really into minimalist code and product design. These are my stories.

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 d...

Link