joshleblanc / view_component_reflex

Call component methods right from your markup
http://view-component-reflex-expo.grep.sh/
MIT License
291 stars 27 forks source link

Lifecycle Callbacks? #13

Closed suan closed 4 years ago

suan commented 4 years ago

Is there any way to set before_reflex etc type callbacks in my ViewComponentReflex::Component? It's been extremely painful without this capability.

Looking further, I think one root cause is that the library inherits off of StimulusReflex::Reflex, whereas many codebases use the base ApplicationReflex pattern... if one could configure a base reflex class, that would be helpful too

joshleblanc commented 4 years ago

Lifecycle methods should now work.

You can now specify the reflex base class with reflex_base_class(new_class) in your component.