You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib.rs
+35-5Lines changed: 35 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,12 @@
1
+
//! This crate provides rusty bindings to SortableJS.
2
+
//!
3
+
//! The documentation mostly lives with [the official SortableJS documentation](https://github.com/SortableJS/Sortable).
4
+
//!
5
+
//! Just adding this crate as a dependency should be enough to get everything working when using [trunk](https://trunkrs.dev/). Just be careful to keep alive the return value of `Sortable::apply`, or you will get JavaScript exceptions.
6
+
//!
7
+
//! You can find example usage of SortableJS from a pure-Rust WASM application
8
+
//! in the `examples/` directory.
9
+
1
10
use std::rc::Rc;
2
11
3
12
use wasm_bindgen::closure::Closure;
@@ -15,6 +24,10 @@ mod js {
15
24
}
16
25
}
17
26
27
+
/// An event raised by one of the Sortable callbacks. See [the official documentation](https://github.com/SortableJS/Sortable#event-object-demo) for details about the fields.
28
+
///
29
+
/// `raw_event` contains the raw JS event, should additional non-documented
/// It must be kept alive on the rust sideas long as the instance can call callbacks, as otherwise the link between the js-side callback and the rust-side callback would be lost.
232
+
/// It must be kept alive on the rust sideas long as the instance can call
233
+
/// callbacks, as otherwise the link between the js-side callback and the
0 commit comments