def set_value(self, value: Any = NoValue) -> Var:
        """Set the value of the client state variable.

        This property can only be attached to a frontend event trigger.

        To set a value from a backend event handler, see `push`.

        Args:
            value: The value to set.

        Returns:
            A special EventChain Var which will set the value when triggered.
        """
        _var_data = VarData(imports=_refs_import if self._global_ref else {})

        setter = (
            Var(_client_state_ref(self._setter_name))
            if self._global_ref
            else Var(self._setter_name, _var_data=_var_data)
        ).to(FunctionVar)

        if value is not NoValue:
            # This is a hack to make it work like an EventSpec taking an arg
            value_var = LiteralVar.create(value)
            value_str = str(value_var)

            setter = ArgsFunctionOperationBuilder.create(
                # remove patterns of ["*"] from the value_str using regex
                args_names=(re.sub(r"\[\".*\"\]", "", value_str),)
                if value_str.startswith("_")
                else (),
                return_expr=setter.call(value_var),
            )

        return setter.to(FunctionVar, EventChain)
Set the value of the client state variable.

        This property can only be attached to a frontend event trigger.

        To set a value from a backend event handler, see `push`.

        Args:
            value: The value to set.

        Returns:
            A special EventChain Var which will set the value when triggered.
        
reflex/experimental/client_state.py