I do continue to wonder, am I a lead or a manager?
I'm soon starting in a new company in the role as tech lead, and there they difference is that the tech lead is focused on anything technical (architecture decisions, language choices, deploy procedures, prioritizing and organizing issues, etc.), while the manager role covers anything HR related (performance reviews, 1-on-1s, etc.). There will be some overlap when it comes to mentoring, since I know that also falls under the tech lead role, but I think the split there will be that I focus on guiding the new people on anything tech related while the manager helps them with everything else.
There are also project managers in the mix at the new company, and my role there will be to together with them prioritize tasks to reach our goals and deliver good results - while making sure that the deadlines/estimates given are sensible. The manager person will not be involved here, since this is all project/tech related and not HR related.
At my previous job I had a more combined tech lead and manager role (was a small startup, so that makes everything a bit different), and there I found that I enjoyed the tech responsibilities while I'll be very happy to avoid all the other management parts.
I would consider just passing along the data directly to the functions that need access to it, rather than storing in a global state. If passing each piece of data along as separate parameters is a bit much, you can always create
struct Context { ... }
which keeps tracks of whatever you need and pass that around.Nothing wrong with using
OnceCell
as @heartlessevil@lemmy.one suggested, but I've found that passing it as an argument feels a bit better.