mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-23 00:59:22 -05:00
added book to github actions
This commit is contained in:
parent
00d774c553
commit
45d2c0fd0a
1 changed files with 28 additions and 0 deletions
28
src/use_scroll.rs
Normal file
28
src/use_scroll.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
use crate::use_event_listener;
|
||||
use leptos::*;
|
||||
|
||||
pub struct UseScrollOptions {
|
||||
/// Throttle time in milliseconds for the scroll events. Defaults to 0 (disabled).
|
||||
pub throttle: u32,
|
||||
|
||||
/// After scrolling ends we wait idle + throttle milliseconds before we consider scrolling to have stopped.
|
||||
/// Defaults to 200.
|
||||
pub idle: u32,
|
||||
}
|
||||
|
||||
pub struct UseScrollReturn {
|
||||
pub x: ReadSignal<f64>,
|
||||
pub setX: WriteSignal<f64>,
|
||||
pub y: ReadSignal<f64>,
|
||||
pub setY: WriteSignal<f64>,
|
||||
pub isScrolling: ReadSignal<bool>,
|
||||
pub arrivedState: ReadSignal<Directions>,
|
||||
pub directions: ReadSignal<Directions>,
|
||||
}
|
||||
|
||||
pub struct Directions {
|
||||
pub left: bool,
|
||||
pub right: bool,
|
||||
pub top: bool,
|
||||
pub bottom: bool,
|
||||
}
|
Loading…
Add table
Reference in a new issue