Sharing state between controllers

Is this approach from 2018 still a good way to go?

That is one way to do it and is still valid and is documented here: Stimulus Reference

There is also a new Outlets API that lets controllers communicate with one another if the above approach isn’t appropriate for your case for some reason, e.g. if nesting your controllers isn’t feasible: Stimulus Reference

1 Like