fuseHoverEffect function

void fuseHoverEffect(
  1. FuseHoverEffectFn fn
)

Calls fn when hover enters this component.

/// The fn may optionally return a cleanup function that is called when the hover exits.

Implementation

void fuseHoverEffect(FuseHoverEffectFn fn) {
  Function()? cleanup;

  fuseHoverEnter(() {
    cleanup = fn();
  });

  fuseHoverExit(() {
    cleanup?.call();
    cleanup = null;
  });
}