Get the current :class:`LifeCycleHook`
()
| 22 | |
| 23 | |
| 24 | def current_hook() -> LifeCycleHook: |
| 25 | """Get the current :class:`LifeCycleHook`""" |
| 26 | hook_stack = _HOOK_STATE.get() |
| 27 | if not hook_stack: |
| 28 | msg = "No life cycle hook is active. Are you rendering in a layout?" |
| 29 | raise RuntimeError(msg) |
| 30 | return hook_stack[-1] |
| 31 | |
| 32 | |
| 33 | class LifeCycleHook: |
no test coverage detected