Skip to content
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

Make exports return a Promise that resolves after last callback was called #374

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

thexeos
Copy link
Contributor

@thexeos thexeos commented Feb 8, 2023

Create new variable in document and index exports, which contains a handle for Promise resolve call. When Index is exported directly, then field argument is undefined, thus the Promise is resolved inside the index export method. When Document is exported, then field argument is set, thus preventing Promise to be resolved inside Index export method before all indexes, store, and tags are exported.

There are no breaking changes, although method signature must be updated in documentation, since a Promise is now returned.

Fixes #353

Create new variable in document and index exports, which contains a handle for Promise resolve call. When Index is exported directly, then `field` argument is `undefined`, thus the Promise is resolved inside the index export method. When Document is exported, then `field` argument is set, thus preventing Promise to be resolved inside Index export method before all indexes, store, and tags are exported.
@ts-thomas
Copy link
Contributor

Looks great, thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.export(..) returns bool sync but internally runs async...
2 participants