-
Notifications
You must be signed in to change notification settings - Fork 36
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
How to make the Javascript part of a filter asynchronous #208
Comments
You can't have asynchronous filters, as the rest of the parsing depends on whether the current tag/attribute is valid. You'll have to make your filter synchronous. If your filter depends on the result of a slow resource (e.g. fetching references from a remote database) I suggest you store the results in a local cache, return |
Thank you for your insights. unfortunately I can't seem to find a way to refresh the preview of Flarum. I will have to ask there. |
Yeah, doesn't look like that part of the composer is exposed to the public at the moment. In the meantime, you can probably call |
I am developing an extension for Flarum and I need to make an asynchronous function call in the Javascript part of a filter.
I configured a new TextFormatter tag like so:
(I took inspiration from Flarum's mention extension)
How can I use the result of an asynchronous Javascript call in
filterCrossReferences
? I tried to return a Promise but it does not seem to be supported.The text was updated successfully, but these errors were encountered: