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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#![deny(clippy::undocumented_unsafe_blocks)]
#![cfg_attr(all(feature = "futures-core", feature = "all", feature = "proc-macro"), doc = include_str!("../README.md"))]

#[cfg(feature = "use_effect")]
pub mod effect;

#[cfg(feature = "use_effect")]
pub use effect::effect_fn;

#[cfg(feature = "use_mut")]
pub mod hook_mut;

#[cfg(feature = "use_memo")]
pub mod memo;

#[cfg(feature = "use_debug")]
pub mod debug;

#[cfg(feature = "use_default_pinned")]
pub mod pinned;

#[cfg(feature = "use_lazy_pinned")]
pub mod lazy_pinned;

#[cfg(feature = "use_lazy_pinned_hook")]
pub mod lazy_pinned_hook;

#[cfg(feature = "use_poll_next_update")]
pub mod poll_next_update;

#[cfg(feature = "ShareValue")]
mod share_value;
#[cfg(feature = "ShareValue")]
pub use share_value::ShareValue;

#[cfg(feature = "use_shared_ref")]
pub mod shared_ref;
#[cfg(feature = "use_shared_ref")]
pub use shared_ref::SharedRef;

#[cfg(feature = "use_shared_state")]
pub mod shared_state;

#[cfg(feature = "use_state")]
pub mod state;

#[cfg(feature = "use_uninitialized_hook")]
pub mod uninitialized_hook;

pub mod prelude {
    pub use hooks_core::prelude::*;

    #[cfg(feature = "proc-macro")]
    pub use hooks_macro::hook;

    #[cfg(feature = "use_debug")]
    pub use crate::debug::use_debug;
    #[cfg(feature = "use_effect")]
    pub use crate::effect::{
        use_effect, use_effect_on_next_poll, use_effect_once, use_effect_once_with, use_effect_with,
    };
    #[cfg(feature = "use_mut")]
    pub use crate::hook_mut::{use_mut, use_mut_default, use_mut_with};
    #[cfg(feature = "use_lazy_pinned")]
    pub use crate::lazy_pinned::{use_lazy_pinned, use_lazy_pinned_with};
    #[cfg(feature = "use_lazy_pinned_hook")]
    pub use crate::lazy_pinned_hook::use_lazy_pinned_hook;
    #[cfg(feature = "use_memo")]
    pub use crate::memo::use_memo;
    #[cfg(feature = "use_default_pinned")]
    pub use crate::pinned::use_default_pinned;
    #[cfg(feature = "use_poll_next_update")]
    pub use crate::poll_next_update::use_poll_next_update;
    #[cfg(feature = "use_shared_ref")]
    pub use crate::shared_ref::{use_shared_ref, use_shared_ref_with};
    #[cfg(feature = "use_shared_state")]
    pub use crate::shared_state::{
        use_shared_state, use_shared_state_eq, use_shared_state_eq_with, use_shared_state_with,
    };
    #[cfg(feature = "use_state")]
    pub use crate::state::{
        use_state, use_state_default, use_state_default_n, use_state_eq, use_state_eq_default,
        use_state_eq_default_n, use_state_eq_n, use_state_eq_n_with, use_state_eq_with,
        use_state_n, use_state_n_with, use_state_with,
    };
    #[cfg(feature = "use_uninitialized_hook")]
    pub use crate::uninitialized_hook::use_uninitialized_hook;

    #[cfg(feature = "ShareValue")]
    pub use crate::ShareValue;
}

pub use hooks_core as core;
pub use hooks_core::{
    hook_fn, impl_hook, Hook, HookExt, HookPollNextUpdate, HookPollNextUpdateExt, HookUnmount,
    HookValue, IntoHook, UpdateHook, UpdateHookUninitialized,
};
pub use prelude::*;

pub(crate) mod utils;