High-level API to check whether a component should rerender. Updates the cache if the value has changed.
(self, component_id: str, new_value: Any)
| 216 | self._state_cache[component_id] = self._ensure_hash(new_value) |
| 217 | |
| 218 | def should_render(self, component_id: str, new_value: Any) -> bool: |
| 219 | """ |
| 220 | High-level API to check whether a component should rerender. |
| 221 | Updates the cache if the value has changed. |
| 222 | """ |
| 223 | return self._update_if_changed(component_id, new_value) |
| 224 | |
| 225 | def _ensure_hash(self, value: Any) -> str: |
| 226 | """Convert value to SHA256 hash. Accepts either a hash string or a hashable object.""" |
no test coverage detected