Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: 在Init钩子里,可以访问context的set和get #6727

Closed
Zach889977 opened this issue Jan 13, 2025 · 0 comments
Closed

[Feature]: 在Init钩子里,可以访问context的set和get #6727

Zach889977 opened this issue Jan 13, 2025 · 0 comments

Comments

@Zach889977
Copy link

这个功能解决了什么问题?

Image 假设在unstableMiddleware中set了一个fetch或者其他任何属于当前request上下文的单例变量/对象,在loader中是可以通过context.get被消费的,但是init函数中无法进行消费(没有提供get)。 如果可以的话,希望在init钩子中也能访问到get方法,毕竟都request级别的上下文,如果不能同时访问,就要创建不同的实例。

你期望的 API 是什么样子的?

Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant