1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use *;
/// Obtains the [`UseHover`] registered against the current hook context
/// slot.
///
/// Behaves like `HookContext::use_hook` - the same handle is returned on
/// every render at the same hook index, so the document listeners are
/// attached once and the hover state survives re-renders.
///
/// Attach `get_target()` to the caller's markup with the `ref:`
/// attribute, then read `get_hovered()` inside a render closure to
/// react to the pointer entering or leaving.
///
/// # Returns
///
/// - `UseHover` - The handle, with `get_target()` returning the
/// [`NodeRef`] and `get_hovered()` the reactive `Signal<bool>`.
/// Reports whether a pointer event landed inside the watched element.
///
/// # Arguments
///
/// - `&NodeRef<Element>` - The element being watched.
/// - `&Event` - The pointer event.
///
/// # Returns
///
/// - `bool` - `true` when the event's node is inside the element.
pub