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] 可以支持 solidjs 的的使用吗 #117
Comments
solidjs在我们的计划中,但短期内暂时还没计划支持solidjs。 如果需要,你可以试试自定义statesHook,可以快速满足你的需求。 |
请问这个已经实现了吗? 可以提供一个简单的statesHook 吗?这样对于初次接触Alova 的用户会更友好一点。 |
@tendant 目前还没有实现 |
有人愿意贡献你的一份力量吗? 请阅读贡献指南 |
solid太小众了吧,玩这种新框架的,我不信没能力自己写statesHook |
这有一个简单的实现,没有完整测试,不保证100%可用,也不提供售后 const solidJsHook = {
create: (data) => createSignal(data),
export: (states) => states[0],
dehydrate: (state: any) => state(),
update: (newVal, states) => {
Object.keys(newVal).forEach((key) => {
states[key][1](newVal[key]);
});
},
effectRequest({ handler, removeStates, immediate, watchingStates }) {
onCleanup(removeStates);
immediate && handler();
let timer: any;
(watchingStates || []).forEach((state, i) => {
createEffect(() => {
state();
timer && clearTimeout(timer);
timer = setTimeout(() => {
handler(i);
clearTimeout(timer);
timer = undefined;
}, 8);
});
});
},
}; |
@thinkeW 非常感谢你的贡献啊!🤞 |
我觉得原生微信小程序可以支持下,其他web框架类似的功能不怎么缺。 |
@1075488066 原生小程序支持计划中,期待一下哦 |
你在什么情况下,需要这个功能解决什么问题?
可以支持 solidjs 的的使用吗?
你期望的 API 是什么样子的?
solidjs 与 react 有着相似的响应式使用方法,应该可以很方便的支持
The text was updated successfully, but these errors were encountered: