You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules/no-async-in-computed-properties.md
+13-5Lines changed: 13 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,38 @@
1
1
# Check if there are no asynchronous action inside computed properties (no-async-in-computed-properties)
2
2
3
-
Vue.js has a basic construct which lets computed properties collects dependencies and refreshes them thats why its really important to not use any of asynchronous action inside of them.
3
+
Computed properties should be synchronous. Asynchronous actions inside them may not work as expected and can lead to an unexpected behaviour, that's why you should avoid them.
4
+
If you need async computed properties you might want to consider using additional plugin [vue-async-computed]
4
5
5
6
## :book: Rule Details
6
7
7
8
This rule is aimed at preventing asynchronous methods from being called in computed properties.
8
9
9
-
10
10
:-1: Examples of **incorrect** code for this rule:
0 commit comments