Meteor-Community-Packages / meteor-simple-schema

Meteor integration package for simpl-schema
https://github.com/Meteor-Community-Packages/meteor-simple-schema
MIT License
920 stars 162 forks source link

Update autoValue to accept async function #739

Open sherryysj opened 11 months ago

sherryysj commented 11 months ago

Is your feature request related to a problem? Please describe. Meteor have updated their MongoDB functions to async, such as findOneAsync, and if we use these functions in autoValue function, we have to make the autoValue function as async as well. However, it does not work as autoValue seems won't wait for a promise when being calling.

Describe the solution you'd like autoValue can work for async function

jankapunkt commented 11 months ago

Thank you @sherryysj I checked and this requirement applies to all fields that are computable.

jankapunkt commented 8 months ago

@sherryysj might be of interest to you: https://github.com/Meteor-Community-Packages/meteor-simple-schema/pull/741#issuecomment-1931972172