From 79f5eea0b966f0ea4e7e2ccd2a6e9091b4bd72fb Mon Sep 17 00:00:00 2001 From: Nathaniel Sabanski Date: Fri, 1 Mar 2024 00:47:29 -0800 Subject: [PATCH] Tip about ignoring call chains on missing elements. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 49ae7c5..08500c5 100644 --- a/README.md +++ b/README.md @@ -378,6 +378,10 @@ me().on("click", async event => { * Or, use a relative start. * ▶️ ` ` +#### Ignore call chain when element is missing. +* ▶️ `me("#i_dont_exist")?.classAdd('active')` +* Silence console warning: ▶️ `me("#i_dont_exist", document, false)?.classAdd('active')` + ## 🔌 Your own plugin Feel free to modify Surreal for a project any way you like- but you can use plugins to effortlessly merge functions with new versions.