xh / hoist-core

🏗️ The XH Hoist toolkit for Grails
https://xh.io/
Apache License 2.0
7 stars 2 forks source link

Added closure arg types to Cache/CachedValue documentation #418

Closed jskupsik closed 2 weeks ago

jskupsik commented 2 weeks ago

Just a documentation change - each of these closures had a different signature and I was getting confused.

The Groovy @ClosureParams annotation is more suited for adding type hints to method parameters than to fields, it did not seem to work here.

I settled for a custom but hopefully self-evident syntax of { Type1, Type2, ... -> ReturnType1 | ReturnType2 | .... } in the field comment to explain/remind the user what closure to use in that spot.

lbwexler commented 2 weeks ago

Great Jakub -- Really appreciate the innovation here. Clear improvement -- I am a fan and will adopt.