MCPcopy Index your code
hub / github.com/reactive-python/reactpy / set_current

Method set_current

src/py/reactpy/reactpy/utils.py:37–44  ·  view source on GitHub ↗

Set the current value and return what is now the old value This is nice to use in ``lambda`` functions.

(self, new: _RefValue)

Source from the content-addressed store, hash-verified

35 """The present value"""
36
37 def set_current(self, new: _RefValue) -> _RefValue:
38 """Set the current value and return what is now the old value
39
40 This is nice to use in ``lambda`` functions.
41 """
42 old = self.current
43 self.current = new
44 return old
45
46 def __eq__(self, other: object) -> bool:
47 try:

Callers 6

test_basic_ref_behaviorFunction · 0.95
FirstComponentFunction · 0.45
SecondComponentFunction · 0.45
ChildFunction · 0.45
RootFunction · 0.45
ShowSimpleButtonFunction · 0.45

Calls

no outgoing calls

Tested by 6

test_basic_ref_behaviorFunction · 0.76
FirstComponentFunction · 0.36
SecondComponentFunction · 0.36
ChildFunction · 0.36
RootFunction · 0.36
ShowSimpleButtonFunction · 0.36