code: def when_equal(self, key: Hashable, value: Any, **when_kwargs) -> StateWatcher:
          
  
          def _(snapshot):
              try:
                  return snapshot[key] == value
              except KeyError:
                  return False
  
          return self.when(_, **when_kwargs)
docs: Block until ``state[key] == value``, and then return a copy of the state.
  
          .. include:: /api/state/get_when_equality.rst