-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
will be good to add example with async/await
#308
Comments
is there an example in mind? |
no, I don't have this code in my projects |
Looking for a async/await example. My code doesn't work:
It always return a |
Hi I am still unable to solve this. It will be great if someone can help. |
Hi, I saw your question, but unfortunately it affects methods !!!! and !!! which are used in 90% of cases. those. now you won't be able to use such an example. import request from 'request'
import parser from 'posthtml-parser'
export default (tree) => {
retrun tree.match({ tag: 'user-info' }, async (node) => {
const {name} = await request(`/api/user-info?${node.attrs.dataUserId}`;
node.content.push(name)
return node;
})
} I am still thinking about this solution |
@Scrum Thank you for your response. I ended up using Promise to solve the async issue, but that is definitely not the best in terms of readability in my opinion. |
There will be time and there will be a solution |
will be good to add example with
async/await
Originally posted by @Grawl in #115 (comment)
The text was updated successfully, but these errors were encountered: