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

refactor: pure post fetcher #10

Merged
merged 1 commit into from
Feb 22, 2024
Merged

refactor: pure post fetcher #10

merged 1 commit into from
Feb 22, 2024

Conversation

Chilfish
Copy link
Owner

抽离爬取函数中 vue 的部分,以能够直接在 Electron 的主进程 Node 环境使用

@Chilfish Chilfish merged commit 8d639d7 into main Feb 22, 2024
@Chilfish Chilfish deleted the refactor/fetch branch February 22, 2024 07:38
@Chilfish Chilfish mentioned this pull request Feb 23, 2024
17 tasks
@Chilfish
Copy link
Owner Author

Chilfish commented Mar 21, 2024

well,原来响应式核心的 @vue/reactivity 包是完全脱离 vue 运行时的,可以用在任何 js 环境,包括 nodejs😅

但是如果我们会我们想要使用其中的一部分的话,那么可以看到 ref reactive computed effect 是在 @vue/reactivity 这个包里导出的,然后像是 watch setup 和一些生命周期是在 @vue/runtime-core 这个包里导出的。可以注意到一点也是非常有趣的一点,就是 @vue/reactivity 这个包其实是可以作为一个独立的包使用的,也就是说我可以不依赖于 Vue,我可以基于这个自己做一个框架,甚至我可以在 Node.js,在没有 UI 的环境下去进行使用。

from: antfu.me

@Chilfish
Copy link
Owner Author

虽然现在已经通过函数传参来注入 fetch options,它们脱离 vue 也能够很好地运行,但在外部的调用方能使用上 ref 或许会用起来舒服多些……?

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 this pull request may close these issues.

None yet

1 participant