-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: add lazy option to asyncComputed #247
Conversation
Can you help to resolve the conflicts? Thanks |
About the new options params, given that the other two are optional, maybe at one point the three params could be in a single options object: const asyncComputed( ()=> { ... }, { initial, evaluating, lazy } ) So users are not forced to add One question about the trick using |
@antfu Fixed merge conflict. @matias-capeletto I don't like putting initial value into options object. I think this looks better: const asyncComputed( ()=> { ... }, initial, { evaluating, lazy }) And it should be possible to check if third parameter is ref and support previous api. const asyncComputed( ()=> { ... }, initial, evaluating) I'm actually not sure about effect scope. Will try to write test for this. |
@Demivan the API you proposed looks good to me. Can you update this PR to it? Thanks. The timing problem @matias-capeletto mentioned may cause some edge cases with |
@antfu Updated PR with new API. |
Thanks! See 425a8e0 |
closes #248