pub struct WithLogging;
Expand description
Common HOC patterns
HOC that adds logging to component lifecycle events
Trait Implementations§
Source§impl<T: Component> HigherOrderComponent<T> for WithLogging
impl<T: Component> HigherOrderComponent<T> for WithLogging
Source§type HOCProps = <T as Component>::Props
type HOCProps = <T as Component>::Props
The props type for the HOC itself (should match T::Props)
Source§fn transform_props(hoc_props: &Self::HOCProps) -> T::Props
fn transform_props(hoc_props: &Self::HOCProps) -> T::Props
Transform HOC props into wrapped component props
Source§fn on_wrapped_mount(
component: &mut T,
_context: &MountContext,
_hoc_props: &Self::HOCProps,
) -> Result<(), ComponentError>
fn on_wrapped_mount( component: &mut T, _context: &MountContext, _hoc_props: &Self::HOCProps, ) -> Result<(), ComponentError>
Optional: intercept lifecycle events
Source§fn on_wrapped_update(
component: &mut T,
changes: &StateChanges,
_hoc_props: &Self::HOCProps,
) -> Result<(), ComponentError>
fn on_wrapped_update( component: &mut T, changes: &StateChanges, _hoc_props: &Self::HOCProps, ) -> Result<(), ComponentError>
Optional: intercept state changes
Source§fn on_wrapped_unmount(
component: &mut T,
_context: &UnmountContext,
_hoc_props: &Self::HOCProps,
) -> Result<(), ComponentError>
fn on_wrapped_unmount( component: &mut T, _context: &UnmountContext, _hoc_props: &Self::HOCProps, ) -> Result<(), ComponentError>
Optional: intercept unmount
Source§fn enhance_component(
component: &mut T,
hoc_props: &Self::HOCProps,
) -> Result<(), ComponentError>
fn enhance_component( component: &mut T, hoc_props: &Self::HOCProps, ) -> Result<(), ComponentError>
Optional: modify the wrapped component after creation
Auto Trait Implementations§
impl Freeze for WithLogging
impl RefUnwindSafe for WithLogging
impl Send for WithLogging
impl Sync for WithLogging
impl Unpin for WithLogging
impl UnwindSafe for WithLogging
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more