This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
implicit state declaration #87
Open
Description
From @catmando on November 25, 2015 21:40
why even declare states?
state :foo
is completely redundant, and is at odds with the rest of ruby. executing state.foo should just create foo if it does not yet exist. Typically this will happen in the before_mount macro. This also solves confusion that several people have had because the state macro runs at the class level (not in the instance) but yet it is creating instance level objects.
I vote we allow state variables to (just like instance variables) be created as they are referenced. (method_missing to the rescue)
Why not params: because params do need to be explicitly declared in ruby, so it is again consistent
Copied from original issue: zetachang/react.rb#87