You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
If we want to optionally enable a decorator, we have to create a slice with all other decorators, and in an if statement, splice this in if needed.
Describe the solution you'd like
Simpler would be to use the if statement to return either the decorator or nil, and just pass that into ChainDecorators. Decorators.Handle() would just silently skip any nil Decorators as if they were not passed in. Makes a more convenient API with no run-time overhead.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
If we want to optionally enable a decorator, we have to create a slice with all other decorators, and in an if statement, splice this in if needed.
Describe the solution you'd like
Simpler would be to use the if statement to return either the decorator or nil, and just pass that into ChainDecorators. Decorators.Handle() would just silently skip any nil Decorators as if they were not passed in. Makes a more convenient API with no run-time overhead.
The text was updated successfully, but these errors were encountered: