seed/
helpers.rs

1use std::ops::Not;
2
3/// Alternative to `!`.
4///
5/// # Example
6///
7/// ```rust,ignore
8///div![
9///    "Button",
10///    IF!(not(disabled) => ev(Ev::Click, Msg::Clicked)),
11///]
12/// ```
13pub fn not<T: Not>(predicate: T) -> T::Output {
14    predicate.not()
15}
16
17// @TODO move helpers from lib.rs or shortcuts.rs here
18
19// ------ ------ Tests ------ ------
20
21#[cfg(test)]
22mod tests {
23    use super::*;
24    use wasm_bindgen_test::*;
25
26    #[wasm_bindgen_test]
27    fn helpers_not() {
28        assert!(not(false));
29    }
30}