Can we use async with @computed on model ? Adonis 5 #1599
-
Hi, @computed()
public get callResponseRate () {
return some value from helper `commonHelper.expertResponceRate(this.id)`
} My helper code is
@thetutlage I am not getting value of callResponseRate column. Is there any easy way for this. |
Beta Was this translation helpful? Give feedback.
Answered by
thetutlage
Sep 15, 2020
Replies: 1 comment 1 reply
-
Nope, computed properties cannot be async and it is a design constraint since computed properties are evaluated during model serialization and you cannot have async serialization. I suggest using hooks for this |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
pk4all
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nope, computed properties cannot be async and it is a design constraint since computed properties are evaluated during model serialization and you cannot have async serialization.
I suggest using hooks for this