MCPcopy Index your code
hub / github.com/bugy/script-server / mapped_property

Function mapped_property

src/react/properties.py:232–240  ·  view source on GitHub ↗
(property, map_function)

Source from the content-addressed store, hash-verified

230
231
232def mapped_property(property, map_function):
233 result = Property()
234
235 def updater(old_value, new_value):
236 new_mapped = map_function(new_value)
237 result.set(new_mapped)
238
239 property.subscribe(updater)
240 return result

Callers

nothing calls this directly

Calls 2

PropertyClass · 0.85
subscribeMethod · 0.45

Tested by

no test coverage detected