Closed aalin closed 1 year ago
Transform @foo into self.state[:foo] and @bar into self.state[:bar], also wrap @foo = 123 within self.update { self.state[:foo] = 123 }
@foo
self.state[:foo]
@bar
self.state[:bar]
@foo = 123
self.update { self.state[:foo] = 123 }
Instance variables and global variables aren't really needed in components. State needs to be managed, so better use this syntax.
Not sure if it would be a good idea to keep the globals related to regexps
I just did this for props in the main branch. Need to think a little bit more about what to do about instance variables
Transform
@foo
intoself.state[:foo]
and@bar
intoself.state[:bar]
, also wrap@foo = 123
withinself.update { self.state[:foo] = 123 }
Instance variables and global variables aren't really needed in components. State needs to be managed, so better use this syntax.
Not sure if it would be a good idea to keep the globals related to regexps