We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
根据源码,limu判断produce的回调是否异步是通过isPromiseFn来判断。这只能支持async function() {}的写法,因此未考虑到用户写的是普通函数,最后返回的却是Promise实例的场景。
isPromiseFn
async function() {}
const result = produce(obj, (draft) => { return Promise.resolve().then(...); });
因此建议参考immer https://github.com/immerjs/immer/blob/master/src/core/immerClass.ts#L101 ,替换掉isPromiseFn
The text was updated successfully, but these errors were encountered:
收到建议,感谢你的反馈,修复后会在此在此答复
Sorry, something went wrong.
已支持,见版本1.3.0
1.3.0
No branches or pull requests
根据源码,limu判断produce的回调是否异步是通过
isPromiseFn
来判断。这只能支持async function() {}
的写法,因此未考虑到用户写的是普通函数,最后返回的却是Promise实例的场景。因此建议参考immer https://github.com/immerjs/immer/blob/master/src/core/immerClass.ts#L101 ,替换掉
isPromiseFn
The text was updated successfully, but these errors were encountered: