Add a store object to the request context equal that lets you manipulate a AsyncLocalStorage store, then provide a helper function to get the store anywhere in the function call stack.
For example, this would be help for logging request IDs for all logs from a request without passing down the request ID everywhere.
Alternatively, I could provide a "wrapper" option to wrap the fetch function in your own async local storage. But I don't think that's needed since the context will be per request, which zeta is responsible for handling.
Add a
storeobject to the request context equal that lets you manipulate aAsyncLocalStoragestore, then provide a helper function to get the store anywhere in the function call stack.For example, this would be help for logging request IDs for all logs from a request without passing down the request ID everywhere.
Alternatively, I could provide a "wrapper" option to wrap the fetch function in your own async local storage. But I don't think that's needed since the context will be per request, which zeta is responsible for handling.