@sashko wrote about Template.vars on Medium a while back, but as far as I can tell it hasn’t happened yet. Or am I missing something?
Is that still planned? I like having lots of reactive state rather than doing $(…).something() and I want those things scoped as locally as possible rather than in the session.
For sure that works (though ReactiveDict is better because it can be preserved across hot code pushes), but the problem is that you need to write a bunch of boilerplate to make that work. You need to set up the var and create a helper.
I think it’s not going to be shipped soon, but it’s something that should be able to be implemented in a package via monkey-patching.
You could override the template constructor to automatically add an onCreated hook to create this.state, and create a global helper for Template.state.
Basically, like you said, it’s already possible, and you could create a package to remove boilerplate.