komponent icon indicating copy to clipboard operation
komponent copied to clipboard

Allow injecting a custom renderer class

Open apauly opened this issue 4 years ago • 2 comments

This PR does not really alter the behaviour of the gem, but it allows easier implementation for custom behaviour.

  • The component helper optionally accepts a custom renderer class
  • The ComponentRenderer itself has been refactored a bit to allow customization of property assignment

Use case: We'd like to use komponent in a setup where we need to customize the property assignment to enable localization (including inline editing). The changes in this PR would implement an interface for customization only - without binding to a special kind of customization.

Note: The .rubocop.yml change is due to a warning by rubocop itself

apauly avatar Jun 24 '20 18:06 apauly

Thanks @apauly for your contribution. We'll review it shortly.

Would you mind adding documentation about this change in the README?

Spone avatar Jun 25 '20 07:06 Spone

Hi @Spone ,

sorry for the delayed response - I've now added a section to the README.

apauly avatar Jul 03 '20 22:07 apauly