bbovenzi commented on PR #24770:
URL: https://github.com/apache/airflow/pull/24770#issuecomment-1179566496
> Thanks for your insight. While I think passing functions can make the code
more extensible/tolerant to change (kind of like the strategy pattern in OOP)
it definitely isn't required to complete this task.
>
> I do think passing functions has benefits (like the following), so I hope
we can consider this approach in the future, maybe in a different context.
>
> benefits in this case:
>
> * by passing in a different function to `handleRefresh`, we can modify its
behavior without changing its implementation/tests
> * writing out something like `handleRefresh(getAllDagIds)` gives a little
more information about which dags are being targeted as opposed to
`handleRefresh(true)` (if only we could write `handleRefresh(activeOnly=true)`)
My main issue was reassigning the parameter.
I agree that just `true` isn't too descriptive. We can turn the props into
an object `handleRefresh({ activeOnly = true })`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]