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

proxy open方法内部,config循环引用xhr问题咨询 #116

Open
fujingzhi opened this issue Jul 27, 2023 · 2 comments · May be fixed by #119
Open

proxy open方法内部,config循环引用xhr问题咨询 #116

fujingzhi opened this issue Jul 27, 2023 · 2 comments · May be fixed by #119

Comments

@fujingzhi
Copy link

image
这个proxy open时,图片中箭头所指的config.xhr=xhr循环引用的作用是?感觉这个是多余引用

@DAHUIAAAAA
Copy link
Collaborator

这个应该是将xhr装载进config里,让用户在钩子函数里可以通过config.xhr访问到当前请求的xhr对象吧
image

@fujingzhi
Copy link
Author

如果仅是为了方便用户在钩子函数中获取到xhr对象,建议在钩子函数再增加第3个入参来引用xhr;
目前这种挂载方式,序列化JSON.stringify(config)配置对象时,因为config和xhr循环引用直接报错了,影响后续业务;
image

@cyfung1031 cyfung1031 linked a pull request Aug 16, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants