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
Async Migrations #123
Comments
What kind of migrations are you doing that requires it to be async? |
Specifically I want to use this library https://github.com/sindresorhus/file-type (which I literally just realized is also by you, thanks!!) |
Namely, the conversion from a path to storing something within the store (along with its MIME type) |
There's, unfortunately, no way to make the migration be async without making every single That being said, I made this for you: https://github.com/sindresorhus/make-synchronous |
Thank you for the new package. I can completely understand the magnitude of converting |
In a similar package to this, but for web extensions, make every get/set call await the migration promise. At least 80% sane IMHO? In your case you could do the same, await the migrations before the app is "ready". A lot of apps do that, for example Apple Photos (Mac) and LINE Messages (iOS) |
Given that many other libraries are moving to providing async only APIs the fact that migrations cannot be (reliably) an async function (IMO) is detrimental since moving from sync -> async is a non-breaking change for the migrations type but there is no (sane) way to guarantee an async migration is run to completion before the rest of the application starts doing its work.
The text was updated successfully, but these errors were encountered: