oth.get_hook
Reads or replaces a hook.
Syntax
oth.get_hook(target: any) -> any
Parameters
| Parameter | Type | Description |
|---|---|---|
target | any | The function or object being targeted. |
Returns
| Type | Description |
|---|---|
any | The value produced by the call. |
Description
oth.get_hook is part of the Oth library. Oth works at the raw hook layer. It installs function hooks, exposes their handles and provides trampoline calls.
The call is read-only: it resolves the current value when invoked and does not change the underlying state.
The aliases oth.replace_hook(target, hook) resolve to the same implementation.
Example
local handle = oth.hook(print, function() end)
print(oth.get_hook(print))
oth.replace_hook(print, function() end)
Notes
- Aliases:
oth.replace_hook(target, hook). - Raw hooks bypass closure-level safety; always keep the returned handle so you can unhook.