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