#mutable #size #macro #signals #test #mutables #horrid

macro mutablex

A horrid macro for making mutables of X size

2 releases

0.1.1 Mar 14, 2024
0.1.0 Feb 13, 2024

#597 in Procedural macros

Download history 3/week @ 2024-06-28 16/week @ 2024-07-05 3/week @ 2024-07-26

63 downloads per month

MIT license

6KB
103 lines

MutableX

Create X-sized mutable signals for FutureSignals.

Usage

From tests/basic.rs

#[cfg(test)]
pub mod test {
    use futures_signals::signal::{Mutable, SignalExt};
    use mutablex::mutable_x;

    #[test]
    pub fn basic() {
        mutable_x!(2);

        let stream_a = Mutable::new(1);
        let stream_b = Mutable::new(2);

        let combination = Mutable2::new(stream_a.clone(), stream_b.clone());

        let _ = combination.map(|(a, b)| {
            println!("{} {}", a, b);
        });

        stream_a.set(3);
        stream_b.set(4);
    }
}

Dependencies

~1.5–2.4MB
~47K SLoC