MCPcopy
hub / github.com/plotly/dash / ProxySetProps

Class ProxySetProps

dash/background_callback/_proxy_set_props.py:1–18  ·  view source on GitHub ↗

Defer dictionary item setter to run a custom function on change. Used by background callback manager to save the `set_props` data.

Source from the content-addressed store, hash-verified

1class ProxySetProps(dict):
2 """
3 Defer dictionary item setter to run a custom function on change.
4 Used by background callback manager to save the `set_props` data.
5 """
6
7 def __init__(self, on_change):
8 super().__init__()
9 self.on_change = on_change
10 self._data = {}
11
12 def __setitem__(self, key, value):
13 self.on_change(key, value)
14 self._data.setdefault(key, {})
15 self._data[key] = {**self._data[key], **value}
16
17 def get(self, key, default=None):
18 return self._data.get(key, default)

Callers 4

runFunction · 0.90
async_runFunction · 0.90
runFunction · 0.85
async_runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…