Rather than using one helper per component, it would be nice to have a common helper/base class to handle CRUD for all components. In that case, each component may have to take the responsibility of mere initializing its state and delegate all other functionalities as you have shown here.
Absolutely! The main idea of the article was to pass the component's object using "this" through to the constructor of the helper and having it manage the component's state. What you mentioned makes sense, and it's something I have also applied in practice. Also definitely helps when you have similar components across your application. Thanks for your feedback!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Rather than using one helper per component, it would be nice to have a common helper/base class to handle CRUD for all components. In that case, each component may have to take the responsibility of mere initializing its state and delegate all other functionalities as you have shown here.
Absolutely! The main idea of the article was to pass the component's object using "this" through to the constructor of the helper and having it manage the component's state. What you mentioned makes sense, and it's something I have also applied in practice. Also definitely helps when you have similar components across your application. Thanks for your feedback!