Browse Source

add is none (#5136)

Khaleel Al-Adhami 1 month ago
parent
commit
1898a1c260
1 changed files with 10 additions and 0 deletions
  1. 10 0
      reflex/vars/base.py

+ 10 - 0
reflex/vars/base.py

@@ -1064,6 +1064,16 @@ class Var(Generic[VAR_TYPE]):
 
 
         return boolify(self)
         return boolify(self)
 
 
+    def is_none(self) -> BooleanVar:
+        """Check if the var is None.
+
+        Returns:
+            A BooleanVar object representing the result of the check.
+        """
+        from .number import is_not_none_operation
+
+        return ~is_not_none_operation(self)
+
     def is_not_none(self) -> BooleanVar:
     def is_not_none(self) -> BooleanVar:
         """Check if the var is not None.
         """Check if the var is not None.