react-mentions icon indicating copy to clipboard operation
react-mentions copied to clipboard

Allow `data` function to return a promise

Open srmagura opened this issue 3 years ago • 3 comments

Fixes #314.

If the data function returns a Promise or other thenable, the suggestions are updated when the promise resolves.

The type definitions already have Promise as a valid return type for DataFunc, so this PR brings the actual functionality in line with what you would expect from the types.

I added tests for both types of async data functions, callback-based and promise-based.

I have the Prettier extension enabled and it made some formatting changes. If necessary, I can disable the extension and remake my changes so the diff is as small as possible.

srmagura avatar Jul 22 '22 14:07 srmagura

🦋 Changeset detected

Latest commit: ea8a670e1e5e6cdfa7b3023fef41e6509550fb3a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-mentions Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jul 22 '22 14:07 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-mentions ✅ Ready (Inspect) Visit Preview Jul 22, 2022 at 2:40PM (UTC)

vercel[bot] avatar Jul 22 '22 14:07 vercel[bot]

Any chance to get this merged?

nikeee avatar Jun 10 '23 14:06 nikeee