From 4b8c1f94c30af83d41aad0ffd1974f782bc9af07 Mon Sep 17 00:00:00 2001 From: gioboa Date: Sun, 19 Nov 2023 14:41:00 +0100 Subject: [PATCH] docs: add missing eslint recap --- .../docs/(qwik)/advanced/eslint/index.mdx | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/packages/docs/src/routes/docs/(qwik)/advanced/eslint/index.mdx b/packages/docs/src/routes/docs/(qwik)/advanced/eslint/index.mdx index d8cfaad36ef..2dac69a8584 100644 --- a/packages/docs/src/routes/docs/(qwik)/advanced/eslint/index.mdx +++ b/packages/docs/src/routes/docs/(qwik)/advanced/eslint/index.mdx @@ -295,6 +295,31 @@ import './styles.css'; + + +
+ no-use-visible-task + Warning for "useVisibleTask$" usage, because Qwik tries very hard to defer client code execution for as long as possible. +
+
+ + ✅ + + + 🔔 + +
+

Details

@@ -1039,6 +1064,26 @@ import Image from '~/media/image.png';
Edit examples
+ +
+

no-use-visible-task

+ Qwik tries very hard to defer client code execution for as long as possible. + This is done to give the end-user the best possible user experience. + Running code eagerly blocks the main thread, which prevents the user from interacting until the task is finished. +"useVisibleTask$" is provided as an escape hatch. +
When in doubt, instead of "useVisibleTask$()" use:
+ +
Sometimes it is the only way to achieve the result.
+
In that case, add:
+
// eslint-disable-next-line qwik/no-use-visible-task
+
to the line before "useVisibleTask$" to acknowledge you understand.
+ +
\ No newline at end of file