feat: hook resource sharing
- Dominant language
- Dart
- Stars
- 1.1k
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Description
**Description**
Sometimes, it is useful to resources between the `pre_gen` and `post_gen` hook. Say for example, you perform an expensive computation in the `pre_gen` hook to derive some variables to be used by your template, and would like to reuse the output of such expensive computation in the `post_gen` hook.
This is already possible by defining a variable in the `pre_gen` hook context, to be later consumed by the `post_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 is `Map`.
**Additional Context**
- Private variables, like `_my_var`(leading `_`) might help avoid exposing new variables unnecessarily.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.