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 Request]: added option to use ref instead of shallowRef for data in vue-request@next #179

Open
tachib-shin opened this issue Jan 1, 2023 · 0 comments

Comments

@tachib-shin
Copy link

tachib-shin commented Jan 1, 2023

需求描述 Feature Description

sometimes there are cases where the request to update some properties from the results returned from data (data that knows for sure has been updated.. for example the number of likes returned from another request) will be is a huge cost to reassign the entire data because vue will recalculate all that is involved in it even though there is so little change

i could use v-memo or create another wrap similar to dataR with watchEffect but there is no reason to waste memory like that when we just need to add an option

建议的解决方案 Proposed Solution

added option to use ref instead of shallowRef for data in vue-request@next
example fullRef: true

- const data = shallowRef()
+ const data = fullRef ? ref() : shallowRef()

其他信息 Other information

@tachib-shin tachib-shin changed the title [Feature Request]: added option to use ref instead of shallowRef for data in vue-request@next` [Feature Request]: added option to use ref instead of shallowRef for data in vue-request@next Jan 1, 2023
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

2 participants