feat: hook resource sharing #1256
Labels
enhancement candidate
Candidate for enhancement but additional research is needed
feedback wanted
Looking for feedback from the community
Description
Sometimes, it is useful to resources between the
pre_gen
andpost_gen
hook. Say for example, you perform an expensive computation in thepre_gen
hook to derive some variables to be used by your template, and would like to reuse the output of such expensive computation in thepost_gen
hook.This is already possible by defining a variable in the
pre_gen
hook context, to be later consumed by thepost_gen
hook. However, this exposes a new variable in the template unnecessarily. In addition, there is some casting to do since the hook context variables type isMap<String, dynamic>
.Additional Context
_my_var
(leading_
) might help avoid exposing new variables unnecessarily.The text was updated successfully, but these errors were encountered: